Skip to content

Commit

Permalink
Merge pull request #111 from FusionAuth/jj/chart-version-vars
Browse files Browse the repository at this point in the history
use placeholder vars in chart files
  • Loading branch information
johnjeffers committed Jun 3, 2024
2 parents 3f27e31 + 026cfc5 commit 0e30894
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ on:
push:
tags:
- '**'
workflow_dispatch:

jobs:
release:
Expand All @@ -17,20 +16,23 @@ jobs:
with:
fetch-depth: 0

- name: update FusionAuth app version in misc files
- name: update placeholder versions
working-directory: ./chart
run: |
apk add -q curl jq
APP_VERSION=$(curl -s https://account.fusionauth.io/api/version | jq -r '.versions[]' | sort -V | tail -n 1)
apk add -q curl jq envsubst
echo "Chart: ${GITHUB_REF##*/}"
export APP_VERSION=$(curl -s https://account.fusionauth.io/api/version | jq -r '.versions[]' | sort -V | tail -n 1)
export CHART_VERSION="${GITHUB_REF##*/}"
echo "Chart: $CHART_VERSION"
echo "App: $APP_VERSION"
sed -i 's/\(version: \).*/\1'"${GITHUB_REF##*/}"'/' Chart.yaml
sed -i 's/\(appVersion: \).*/\1'"$APP_VERSION"'/' Chart.yaml
sed -i 's/\(^ tag: \).*/\1'"$APP_VERSION"'/' values.yaml
sed -i 's/\(^ tag: \).*/\1'"$APP_VERSION"'/' examples/minikube/values.yaml
sed -i '/| image.tag/s/\"\([^]]*\)\"/\"'"$APP_VERSION"'\"/' README.md
for file in Chart.yaml values.yaml README.md examples/minikube/values.yaml
do
tmpfile=$(mktemp)
cat "$file" > "$tmpfile"
envsubst < "$tmpfile" > "$file"
done
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
Expand All @@ -40,11 +42,6 @@ jobs:
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global --add safe.directory /__w/charts/charts
- name: commit app version
run: |
git commit -am "Update FusionAuth app version in chart to ${{ env.APP_VERSION }}"
git push
- name: Release
id: release
env:
Expand Down
4 changes: 2 additions & 2 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: fusionauth
description: Helm chart for FusionAuth
type: application
version: 0.0.0+dev
appVersion: "1.50.1"
version: ${CHART_VERSION}
appVersion: ${APP_VERSION}
2 changes: 1 addition & 1 deletion chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The helm chart is versioned independently from FusionAuth app releases. However,
| fullnameOverride | string | `""` | Overrides full resource names. |
| image.pullPolicy | string | `"IfNotPresent"` | Kubernetes image pullPolicy to use for fusionauth-app. |
| image.repository | string | `"fusionauth/fusionauth-app"` | The image repository to use for fusionauth-app. |
| image.tag | string | `"1.50.1"` | The image tag to pull for fusionauth-app (this is the fusionauth-app version). |
| image.tag | string | `"${APP_VERSION}"` | The image tag to pull for fusionauth-app (this is the fusionauth-app version). |
| imagePullSecrets | list | `[]` | Configures Kubernetes secrets to use for pulling images from private repositories. |
| ingress.annotations | object | `{}` | Configure annotations to add to the ingress object. |
| ingress.enabled | bool | `false` | Enables ingress creation for fusionauth. |
Expand Down
2 changes: 1 addition & 1 deletion chart/examples/minikube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image:
# image.repository -- The name of the docker repository for fusionauth-app
repository: fusionauth/fusionauth-app
# image.repository -- The docker tag to pull for fusionauth-app
tag: 1.50.1
tag: ${APP_VERSION}
# image.pullPolicy -- Kubernetes image pullPolicy to use for fusionauth-app
pullPolicy: IfNotPresent

Expand Down
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ image:
# image.repository -- The name of the docker repository for fusionauth-app
repository: fusionauth/fusionauth-app
# image.repository -- The docker tag to pull for fusionauth-app
tag: 1.50.1
tag: ${APP_VERSION}
# image.pullPolicy -- Kubernetes image pullPolicy to use for fusionauth-app
pullPolicy: IfNotPresent

Expand Down

0 comments on commit 0e30894

Please sign in to comment.