Skip to content

Commit

Permalink
Merge pull request #853 from ssl-hep/fix_helm_tags
Browse files Browse the repository at this point in the history
Update the chart's values.yaml to use released images
  • Loading branch information
ponyisi authored Sep 25, 2024
2 parents 89c0e77 + 3d44282 commit f617d64
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions .github/workflows/ci_helm_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,42 @@ jobs:
echo "DOCKER_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "$DOCKER_TAG"
- name: Set version in flux_river_configs
- name: Set version in helm values.yaml
# Update the tags for images in the helm Chart.yaml and values.yaml to match
# The deployed docker image tag
uses: mikefarah/[email protected]
with:
cmd: |
yq -i '.spec.chart.spec.version = strenv(RELEASE_VERSION) | .spec.chart.spec.version style="double" ' flux_river_configs/servicex-int/values.yaml &&
# Update the version of the helm chart
yq -i '.appVersion = strenv(RELEASE_VERSION) | .appVersion style="double" | .version = "'$RELEASE_VERSION'"| .version style="double" ' helm/servicex/Chart.yaml &&
# Update the tags for the well known images in the helm values.yaml
yq -i '.app.tag = strenv(DOCKER_TAG) | .app.tag style="double" |
.didFinder.rucio.tag = strenv(DOCKER_TAG) | .didFinder.rucio.tag style="double" |
.didFinder.CERNOpenData.tag = strenv(DOCKER_TAG) | .didFinder.CERNOpenData.tag style="double" |
.transformer.sidecarTag = strenv(DOCKER_TAG) | .transformer.sidecarTag style="double" |
.x509Secrets.tag = strenv(DOCKER_TAG) | .x509Secrets.tag style="double" ' helm/servicex/Chart.yaml &&
CODEGENS=$(yq '.spec.values.codeGen | keys | .[]' flux_river_configs/servicex-int/values.yaml) && for i in $CODEGENS; do yq -i '.spec.values.codeGen.[$i].tag=strenv(DOCKER_TAG) | .spec.values.codeGen.[$i].tag style="double"' flux_river_configs/servicex-int/values.yaml; done
.minioCleanup.tag = strenv(DOCKER_TAG) | .minioCleanup.tag style="double" |
.x509Secrets.tag = strenv(DOCKER_TAG) | .x509Secrets.tag style="double" ' helm/servicex/values.yaml &&
# Loop over each of the DID Finders to update the tags for each
DIDFINDERS=$(yq '.didFinder | keys | .[]' helm/servicex/values.yaml) &&
for i in $DIDFINDERS; do yq -i '.didFinder.[$i].tag=strenv(DOCKER_TAG) | .didFinder.[$i].tag style="double"' helm/servicex/values.yaml; done &&
# Loop over each of the Codegens to update the tags for each
CODEGENS=$(yq '.codeGen | keys | .[]' helm/servicex/values.yaml) &&
for i in $CODEGENS; do yq -i '.codeGen.[$i].tag=strenv(DOCKER_TAG) | .codeGen.[$i].tag style="double"' helm/servicex/values.yaml; done
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.9.2

- name: Create helm package
working-directory: ./helm
run: |
helm dependency update servicex
helm package servicex
mv servicex-$RELEASE_VERSION.tgz ../ssl-helm-charts
helm repo index ../ssl-helm-charts --url https://ssl-hep.github.io/ssl-helm-charts/
- name: Pushes to ssl-helm-packages repository
uses: cpina/[email protected]
env:
Expand All @@ -69,6 +86,14 @@ jobs:
destination-repository-name: 'ssl-helm-charts'
target-branch: 'gh-pages'
user-email: '[email protected]'

- name: Set version in flux_river_config for the production environment
uses: mikefarah/[email protected]
with:
cmd: |
# Update the chart version to pick up
yq -i '.spec.chart.spec.version = strenv(RELEASE_VERSION) | .spec.chart.spec.version style="double" ' flux_river_configs/servicex-prod/values.yaml
- name: Pushes to flux-river-configs repository
uses: cpina/[email protected]
env:
Expand All @@ -79,6 +104,7 @@ jobs:
destination-repository-name: 'flux_river_configs'
target-branch: 'main'
user-email: '[email protected]'

- name: Create Release
id: create_release
uses: softprops/[email protected]
Expand Down

0 comments on commit f617d64

Please sign in to comment.