Skip to content

Commit

Permalink
chore: add release version to helm chart and grafana annoation
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmrtvy committed Oct 25, 2024
1 parent e8a2722 commit d481f18
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/deploy_helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,16 @@ jobs:
EKSCTL_VERSION: v0.98.0
# renovate: datasource=github-releases depName=helmfile/helmfile
HELMFILE_VERSION: 'v0.155.1'
# TODO: remove sops as it is not used anymore
SOPS_VERSION: v3.7.2
# TODO: remove secrets plugin as it is not used anymore
HELM_SECRETS_PLUGIN_VERSION: v3.8.3
# renovate: datasource=github-releases depName=databus23/helm-diff
HELM_DIFF_PLUGIN_VERSION: v3.9.6
# renovate: datasource=github-releases depName=mikefarah/yq
YQ_VERSION: v4.44.3
run: |
HELMFILE_VERSION_WITHOUT_PREFIX=${HELMFILE_VERSION:1}
curl -fsSL -o eksctl.tar.gz https://github.com/weaveworks/eksctl/releases/download/${{ env.EKSCTL_VERSION }}/eksctl_Linux_amd64.tar.gz
curl -fsSL -o helmfile.tar.gz https://github.com/helmfile/helmfile/releases/download/${{ env.HELMFILE_VERSION }}/helmfile_${HELMFILE_VERSION_WITHOUT_PREFIX}_linux_amd64.tar.gz
curl -fsSL -o sops https://github.com/mozilla/sops/releases/download/${{ env.SOPS_VERSION }}/sops-${{ env.SOPS_VERSION }}.linux
curl -fsSL -o yq https://github.com/mikefarah/yq/releases/download/${{ env.YQ_VERSION }}/yq_linux_amd64
helm plugin install https://github.com/jkroepke/helm-secrets --version ${{ env.HELM_SECRETS_PLUGIN_VERSION }}
helm plugin install https://github.com/databus23/helm-diff --version ${{ env.HELM_DIFF_PLUGIN_VERSION }}
mkdir -p $HOME/.local/bin
Expand Down Expand Up @@ -196,6 +193,14 @@ jobs:
tags: tag:ci
version: 1.72.0

- name: Inject release version to the helm chart
if: inputs.revision != ''
run: |
release=$(git tag --contains ${{ inputs.revision }})
find . -name "Chart.yaml" | while IFS= read -r file; do
yq -i '.appVersion = "'"$release"'"-${{ inputs.revision }}' "$file"
done
- name: helmfile ${{ inputs.helmfileCommand }}
run: |
export $(echo ${{ inputs.envVariables }})
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release_marker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,17 @@ jobs:
if: inputs.revision != ''
runs-on: ubuntu-latest
steps:
- name: get release version from revision
id: releaseVer
run: |
release=$(git tag --contains ${{ inputs.revision }})
- name: mark release
uses: frankie567/[email protected]
with:
apiHost: https://grafana.apify.dev
apiToken: ${{ secrets.grafanaApiToken}}
text: ${{ inputs.environment }} - Deployment of ${{ inputs.revision }}
text: ${{ inputs.environment }} - Deployment of ${{ steps.releaseVer.outputs.stdout }}-${{ inputs.revision }}
tags: deployment,github,${{ inputs.environment }},${{ inputs.grafanaAnnotationTag }}

sentry:
Expand Down

0 comments on commit d481f18

Please sign in to comment.