From d481f18476f5575e4ea0e0e6f640c061fcbc43f7 Mon Sep 17 00:00:00 2001 From: Lukas Mrtvy Date: Fri, 25 Oct 2024 16:31:06 +0200 Subject: [PATCH 1/3] chore: add release version to helm chart and grafana annoation --- .github/workflows/deploy_helmfile.yaml | 17 +++++++++++------ .github/workflows/release_marker.yaml | 7 ++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy_helmfile.yaml b/.github/workflows/deploy_helmfile.yaml index 70a4f76..8c83640 100644 --- a/.github/workflows/deploy_helmfile.yaml +++ b/.github/workflows/deploy_helmfile.yaml @@ -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 @@ -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 }}) diff --git a/.github/workflows/release_marker.yaml b/.github/workflows/release_marker.yaml index 643a89d..525db26 100644 --- a/.github/workflows/release_marker.yaml +++ b/.github/workflows/release_marker.yaml @@ -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/grafana-annotation-action@v1.0.3 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: From 0147aeeb87a66c340560c58c93e9667d8e88c426 Mon Sep 17 00:00:00 2001 From: Lukas M Date: Tue, 29 Oct 2024 14:13:30 +0100 Subject: [PATCH 2/3] Update deploy_helmfile.yaml --- .github/workflows/deploy_helmfile.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_helmfile.yaml b/.github/workflows/deploy_helmfile.yaml index 8c83640..ea58e2d 100644 --- a/.github/workflows/deploy_helmfile.yaml +++ b/.github/workflows/deploy_helmfile.yaml @@ -196,9 +196,9 @@ jobs: - name: Inject release version to the helm chart if: inputs.revision != '' run: | - release=$(git tag --contains ${{ inputs.revision }}) + release=$(git tag --contains "${{ inputs.revision }}") find . -name "Chart.yaml" | while IFS= read -r file; do - yq -i '.appVersion = "'"$release"'"-${{ inputs.revision }}' "$file" + yq -i '.appVersion = '"$release"'-${{ inputs.revision }}' "$file" done - name: helmfile ${{ inputs.helmfileCommand }} From 8d345a9d9fecba941b271302fa2866510117a033 Mon Sep 17 00:00:00 2001 From: Lukas M Date: Tue, 29 Oct 2024 14:14:33 +0100 Subject: [PATCH 3/3] Update release_marker.yaml --- .github/workflows/release_marker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_marker.yaml b/.github/workflows/release_marker.yaml index 525db26..821f2ac 100644 --- a/.github/workflows/release_marker.yaml +++ b/.github/workflows/release_marker.yaml @@ -84,7 +84,7 @@ jobs: - name: get release version from revision id: releaseVer run: | - release=$(git tag --contains ${{ inputs.revision }}) + release=$(git tag --contains "${{ inputs.revision }}") - name: mark release uses: frankie567/grafana-annotation-action@v1.0.3