better image tagging in helmfile
This commit is contained in:
parent
d2a56c4334
commit
67cfcc9590
3
.github/workflows/publish.yml
vendored
3
.github/workflows/publish.yml
vendored
@ -83,9 +83,10 @@ jobs:
|
|||||||
mkdir -p ~/.kube
|
mkdir -p ~/.kube
|
||||||
sops decrypt ./helmfile/secrets/kubeconfig > ~/.kube/config
|
sops decrypt ./helmfile/secrets/kubeconfig > ~/.kube/config
|
||||||
chmod 600 ~/.kube/config
|
chmod 600 ~/.kube/config
|
||||||
- run: echo "IMAGE_TAG=ocelot-${{ inputs.ocelot_version }}--branded-sha-$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
|
|
||||||
- uses: helmfile/helmfile-action@80fbb6408b98822310f94d8d1321a2cacf87f78f #v1.9.2
|
- uses: helmfile/helmfile-action@80fbb6408b98822310f94d8d1321a2cacf87f78f #v1.9.2
|
||||||
with:
|
with:
|
||||||
|
env:
|
||||||
|
OCELOT_IMAGE_TAG: ${{ inputs.ocelot_version }}
|
||||||
helmfile-args: apply
|
helmfile-args: apply
|
||||||
helmfile-workdirectory: ./helmfile
|
helmfile-workdirectory: ./helmfile
|
||||||
helm-plugins: >
|
helm-plugins: >
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
{{ $branded_image_tag:= env "BRANDED_IMAGE_TAG" | default (exec "../scripts/image_tag.sh" (list) | trim) }}
|
||||||
|
{{ $ocelot_image_tag := env "OCELOT_IMAGE_TAG" | default "master" }}
|
||||||
|
|
||||||
domain: staging.ocelot-social.roschaefer.de
|
domain: staging.ocelot-social.roschaefer.de
|
||||||
namespace: ocelot-staging
|
namespace: ocelot-staging
|
||||||
image_tag: {{ requiredEnv "IMAGE_TAG" }}
|
image_tag: {{ env "IMAGE_TAG" | default (printf "ocelot-%s--branded-%s" $ocelot_image_tag $branded_image_tag) }}
|
||||||
|
|||||||
2
helmfile/scripts/image_tag.sh
Executable file
2
helmfile/scripts/image_tag.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
echo "sha-$(git rev-parse HEAD | cut -c 1-7)"
|
||||||
Loading…
x
Reference in New Issue
Block a user