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
chart-path: charts/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: Discord Webhook Action

View File

@ -199,7 +199,11 @@ spec:
value: {{ .Values.services.tlsRejectUnauthorized }}
{{ 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
livenessProbe:
httpGet:

View File

@ -37,7 +37,11 @@ spec:
{{ end }}
spec:
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
name: proxy-service
ports:

View File

@ -189,7 +189,11 @@ spec:
value: {{ .Values.services.tlsRejectUnauthorized }}
{{ 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
livenessProbe:
httpGet:

View File

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

View File

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