Skip to content

Commit f259cc1

Browse files
author
Craig Furman
authored
feat(appliance): update image tags and chart version on release (#534)
* appliance: value schema conforms to what sg-ops expects * release: update appliance artifacts
1 parent 8a6a9d3 commit f259cc1

File tree

6 files changed

+74
-40
lines changed

6 files changed

+74
-40
lines changed
Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
11
apiVersion: v2
22
name: sourcegraph-appliance
33
description: The Sourcegraph Appliance
4-
5-
# A chart can be either an 'application' or a 'library' chart.
6-
#
7-
# Application charts are a collection of templates that can be packaged into versioned archives
8-
# to be deployed.
9-
#
10-
# Library charts provide useful utilities or functions for the chart developer. They're included as
11-
# a dependency of application charts to inject those utilities and functions into the rendering
12-
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
134
type: application
145

15-
# This is the chart version. This version number should be incremented each time you make changes
16-
# to the chart and its templates, including the app version.
17-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 5.5.3738
6+
# Chart version, separate from Sourcegraph
7+
version: "5.6.185"
198

20-
# This is the version number of the application being deployed. This version number should be
21-
# incremented each time you make changes to the application. Versions are not expected to
22-
# follow Semantic Versioning. They should reflect the version the application is using.
23-
# It is recommended to use it with quotes.
24-
appVersion: "5.5.3738"
9+
# Version of Sourcegraph release
10+
appVersion: "5.6.185"

charts/sourcegraph-appliance/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ In addition to the documented values, all services also support the following va
3030
|-----|------|---------|-------------|
3131
| affinity | object | `{}` | |
3232
| airgap.enabled | bool | `false` | |
33-
| frontend.image.image | string | `"appliance-frontend"` | |
34-
| frontend.image.tag | string | `"5.5.3738"` | |
33+
| backend.image.defaultTag | string | `"5.6.0@sha256:ace022ecd58fdbca9a51b4100afacd19ecf2afca5dbe62ccb087c66639fb130f"` | |
34+
| backend.image.name | string | `"appliance"` | |
35+
| frontend.image.defaultTag | string | `"5.6.0@sha256:812c91b6551bab5894fa2cd9c35ff636652d00c7272841d67310d440543cafbe"` | |
36+
| frontend.image.name | string | `"appliance-frontend"` | |
3537
| fullnameOverride | string | `""` | |
36-
| image.image | string | `"appliance"` | |
37-
| image.pullPolicy | string | `"IfNotPresent"` | |
38-
| image.repository | string | `"index.docker.io/sourcegraph"` | |
39-
| image.tag | string | `"5.5.3738"` | |
4038
| imagePullSecrets | list | `[]` | |
4139
| ingress.annotations | object | `{}` | |
4240
| ingress.className | string | `""` | |
@@ -66,4 +64,6 @@ In addition to the documented values, all services also support the following va
6664
| serviceAccount.automount | bool | `true` | |
6765
| serviceAccount.create | bool | `true` | |
6866
| serviceAccount.name | string | `"sourcegraph-appliance"` | |
67+
| sourcegraph.image.pullPolicy | string | `"IfNotPresent"` | |
68+
| sourcegraph.image.repository | string | `"index.docker.io/sourcegraph"` | |
6969
| tolerations | list | `[]` | |

charts/sourcegraph-appliance/templates/deployment-frontend.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ spec:
2626
{{- end }}
2727
app: sourcegraph-appliance-frontend
2828
spec:
29-
{{- with .Values.imagePullSecrets }}
29+
{{- with .Values.sourcegraph.imagePullSecrets }}
3030
imagePullSecrets:
3131
{{- toYaml . | nindent 8 }}
3232
{{- end }}
@@ -37,8 +37,8 @@ spec:
3737
- name: {{ .Chart.Name }}
3838
securityContext:
3939
{{- toYaml .Values.securityContext | nindent 12 }}
40-
image: "{{ .Values.image.repository }}/{{ .Values.frontend.image.image }}:{{ .Values.frontend.image.tag | default .Chart.AppVersion }}"
41-
imagePullPolicy: {{ .Values.image.pullPolicy }}
40+
image: "{{ .Values.sourcegraph.image.repository }}/{{ .Values.frontend.image.name }}:{{ .Values.frontend.image.defaultTag | default .Chart.AppVersion }}"
41+
imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }}
4242
env:
4343
- name: API_ENDPOINT
4444
value: http://sourcegraph-appliance-backend:8080

charts/sourcegraph-appliance/templates/deployment.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ spec:
2222
{{- end }}
2323
app: sourcegraph-appliance
2424
spec:
25-
{{- with .Values.imagePullSecrets }}
25+
{{- with .Values.sourcegraph.imagePullSecrets }}
2626
imagePullSecrets:
2727
{{- toYaml . | nindent 8 }}
2828
{{- end }}
@@ -33,13 +33,13 @@ spec:
3333
- name: {{ .Chart.Name }}
3434
securityContext:
3535
{{- toYaml .Values.securityContext | nindent 12 }}
36-
image: "{{ .Values.image.repository }}/{{ .Values.image.image}}:{{ .Values.image.tag | default .Chart.AppVersion }}"
37-
imagePullPolicy: {{ .Values.image.pullPolicy }}
36+
image: "{{ .Values.sourcegraph.image.repository }}/{{ .Values.backend.image.name}}:{{ .Values.backend.image.defaultTag | default .Chart.AppVersion }}"
37+
imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }}
3838
env:
3939
- name: SRC_LOG_LEVEL
40-
value: {{ default "info" .Values.image.log_level }}
40+
value: {{ default "info" .Values.sourcegraph.image.log_level }}
4141
- name: APPLIANCE_VERSION
42-
value: "{{ .Values.image.version | default .Chart.AppVersion }}"
42+
value: "{{ .Values.sourcegraph.image.version | default .Chart.AppVersion }}"
4343
- name: APPLIANCE_NAMESPACE
4444
valueFrom:
4545
fieldRef:

charts/sourcegraph-appliance/values.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
# Declare variables to be passed into your templates.
44
replicaCount: 1
55

6-
image:
7-
repository: index.docker.io/sourcegraph
8-
image: appliance
9-
pullPolicy: IfNotPresent
10-
# Overrides the image tag whose default is the chart appVersion.
11-
tag: &version "5.5.3738"
6+
sourcegraph:
7+
image:
8+
repository: index.docker.io/sourcegraph
9+
pullPolicy: IfNotPresent
10+
# Overrides the image tag whose default is the chart appVersion.
1211
# Version and Tag (above) are subtley different
1312
# Tag is the docker container tag
1413
# Version is the internal version number as understood by appliance
@@ -17,6 +16,12 @@ image:
1716
# version: 5.4.7765
1817
# log_level: debug
1918

19+
20+
backend:
21+
image:
22+
name: appliance
23+
defaultTag: "5.6.0@sha256:ace022ecd58fdbca9a51b4100afacd19ecf2afca5dbe62ccb087c66639fb130f"
24+
2025
imagePullSecrets: []
2126
nameOverride: ""
2227
fullnameOverride: ""
@@ -100,9 +105,9 @@ affinity: {}
100105

101106
frontend:
102107
image:
103-
image: appliance-frontend
108+
name: appliance-frontend
104109
# Overrides the image tag whose default is the chart appVersion.
105-
tag: *version
110+
defaultTag: "5.6.0@sha256:812c91b6551bab5894fa2cd9c35ff636652d00c7272841d67310d440543cafbe"
106111

107112
selfUpdate:
108113
enabled: true

release.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,35 @@ internal:
7979
--docker-password $DOCKER_PASSWORD \
8080
charts/sourcegraph-migrator/
8181
82+
- name: sg ops:appliance
83+
cmd: |
84+
set -eu
85+
registry=us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal
86+
87+
sg ops update-images \
88+
-t {{inputs.server.tag}} \
89+
-k helm \
90+
--registry "${registry}" \
91+
--docker-username $DOCKER_USERNAME \
92+
--docker-password $DOCKER_PASSWORD \
93+
charts/sourcegraph-appliance/
94+
8295
- name: "chart:version"
8396
cmd: |
8497
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml
8598
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph/examples/subchart/Chart.yaml
8699
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml
87100
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml
88101
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml
102+
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-appliance/Chart.yaml
89103
90104
- name: "chart:appVersion"
91105
cmd: |
92106
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml
93107
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml
94108
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml
95109
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml
110+
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-appliance/Chart.yaml
96111
97112
- name: "helm:docs"
98113
cmd: ./scripts/helm-docs.sh
@@ -177,20 +192,35 @@ internal:
177192
--docker-password $DOCKER_PASSWORD \
178193
charts/sourcegraph-migrator/
179194
195+
- name: sg ops:appliance
196+
cmd: |
197+
set -eu
198+
registry=us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal
199+
200+
sg ops update-images \
201+
-t {{inputs.server.tag}} \
202+
-k helm \
203+
--registry "${registry}" \
204+
--docker-username $DOCKER_USERNAME \
205+
--docker-password $DOCKER_PASSWORD \
206+
charts/sourcegraph-appliance/
207+
180208
- name: "chart:version"
181209
cmd: |
182210
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml
183211
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph/examples/subchart/Chart.yaml
184212
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml
185213
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml
186214
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml
215+
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-appliance/Chart.yaml
187216
188217
- name: "chart:appVersion"
189218
cmd: |
190219
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml
191220
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml
192221
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml
193222
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml
223+
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-appliance/Chart.yaml
194224
195225
- name: "helm:docs"
196226
cmd: ./scripts/helm-docs.sh
@@ -282,13 +312,15 @@ internal:
282312
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml
283313
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml
284314
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml
315+
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-appliance/Chart.yaml
285316
286317
- name: "chart:appVersion"
287318
cmd: |
288319
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml
289320
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml
290321
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml
291322
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml
323+
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-appliance/Chart.yaml
292324
293325
- name: "helm:docs"
294326
cmd: ./scripts/helm-docs.sh
@@ -437,6 +469,17 @@ promoteToPublic:
437469
--docker-username $DOCKER_USERNAME \
438470
--docker-password $DOCKER_PASSWORD \
439471
charts/sourcegraph-migrator/
472+
- name: sg ops:appliance
473+
cmd: |
474+
set -eu
475+
registry=index.docker.io/sourcegraph
476+
sg ops update-images \
477+
-t {{inputs.server.tag}} \
478+
-k helm \
479+
--registry "${registry}" \
480+
--docker-username $DOCKER_USERNAME \
481+
--docker-password $DOCKER_PASSWORD \
482+
charts/sourcegraph-appliance/
440483
- name: "update helm docs"
441484
cmd: ./scripts/helm-docs.sh
442485
- name: "git:branch"

0 commit comments

Comments
 (0)