Use helm .Chart.AppVersion instead of specifying value (#9933)

* Use helm .Chart.AppVersion instead of specifying value

* Backwards compatibility with existing process for deploying chart from source where Chart.AppVersion hasn't been generated yet
This commit is contained in:
Rory Powell 2023-04-12 13:49:25 +01:00 committed by GitHub
parent cc929b93a9
commit 3b9887c66c
6 changed files with 17 additions and 12 deletions

View File

@ -55,7 +55,7 @@ jobs:
config-files: values.production.yaml config-files: values.production.yaml
chart-path: charts/budibase chart-path: charts/budibase
namespace: budibase namespace: budibase
values: globals.appVersion=v${{ env.RELEASE_VERSION }},services.couchdb.url=${{ secrets.PRODUCTION_COUCHDB_URL }},services.couchdb.password=${{ secrets.PRODUCTION_COUCHDB_PASSWORD }} values: globals.appVersion=${{ env.RELEASE_VERSION }},services.couchdb.url=${{ secrets.PRODUCTION_COUCHDB_URL }},services.couchdb.password=${{ secrets.PRODUCTION_COUCHDB_PASSWORD }}
name: budibase-prod name: budibase-prod
- name: Discord Webhook Action - name: Discord Webhook Action

View File

@ -199,7 +199,11 @@ spec:
value: {{ .Values.services.tlsRejectUnauthorized }} value: {{ .Values.services.tlsRejectUnauthorized }}
{{ end }} {{ end }}
image: budibase/apps:{{ .Values.globals.appVersion }} {{ if .Values.globals.appVersion }}
image: budibase/apps:v{{ .Values.globals.appVersion }}
{{ else }}
image: budibase/apps:v{{ .Chart.AppVersion }}
{{ end }}
imagePullPolicy: Always imagePullPolicy: Always
livenessProbe: livenessProbe:
httpGet: httpGet:

View File

@ -37,7 +37,11 @@ spec:
{{ end }} {{ end }}
spec: spec:
containers: containers:
- image: budibase/proxy:{{ .Values.globals.appVersion }} {{ if .Values.globals.appVersion }}
image: budibase/proxy:v{{ .Values.globals.appVersion }}
{{ else }}
image: budibase/proxy:v{{ .Chart.AppVersion }}
{{ end }}
imagePullPolicy: Always imagePullPolicy: Always
name: proxy-service name: proxy-service
ports: ports:

View File

@ -189,7 +189,11 @@ spec:
value: {{ .Values.services.tlsRejectUnauthorized }} value: {{ .Values.services.tlsRejectUnauthorized }}
{{ end }} {{ end }}
image: budibase/worker:{{ .Values.globals.appVersion }} {{ if .Values.globals.appVersion }}
image: budibase/worker:v{{ .Values.globals.appVersion }}
{{ else }}
image: budibase/worker:v{{ .Chart.AppVersion }}
{{ end }}
imagePullPolicy: Always imagePullPolicy: Always
livenessProbe: livenessProbe:
httpGet: httpGet:

View File

@ -74,7 +74,7 @@ tolerations: []
affinity: {} affinity: {}
globals: globals:
appVersion: "latest" appVersion: "" # Use as an override to .Chart.AppVersion
budibaseEnv: PRODUCTION budibaseEnv: PRODUCTION
tenantFeatureFlags: "*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR" tenantFeatureFlags: "*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR"
enableAnalytics: "1" enableAnalytics: "1"

View File

@ -2,15 +2,8 @@ const yaml = require("js-yaml")
const fs = require("fs") const fs = require("fs")
const path = require("path") const path = require("path")
const UpgradeTypes = {
MAJOR: "major",
MINOR: "minor",
PATCH: "patch"
}
const CHART_PATH = path.join(__dirname, "../", "charts", "budibase", "Chart.yaml") const CHART_PATH = path.join(__dirname, "../", "charts", "budibase", "Chart.yaml")
const UPGRADE_VERSION = process.env.BUDIBASE_RELEASE_VERSION const UPGRADE_VERSION = process.env.BUDIBASE_RELEASE_VERSION
const UPGRADE_TYPE = process.env.HELM_CHART_UPGRADE_TYPE || UpgradeTypes.PATCH
if (!UPGRADE_VERSION) { if (!UPGRADE_VERSION) {
throw new Error("BUDIBASE_RELEASE_VERSION env var must be set.") throw new Error("BUDIBASE_RELEASE_VERSION env var must be set.")