From 2733a8d9e03517ce0e6d9c8a2015ce37ee06fc31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Elnan?= Date: Mon, 18 Nov 2024 16:56:36 +0100 Subject: [PATCH] build v2 --- .github/workflows/agent.yml | 3 ++- .github/workflows/agentv2.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/agent.yml b/.github/workflows/agent.yml index 33c1d58..99a072b 100644 --- a/.github/workflows/agent.yml +++ b/.github/workflows/agent.yml @@ -5,6 +5,7 @@ on: paths-ignore: - 'v2/**' - '.github/workflows/agentv2.yml' + - 'charts/ror-cluster-agent-v2/**' # Publish semver tags as releases. #tags: [ 'v*.*.*' ] pull_request: @@ -162,6 +163,7 @@ jobs: runs-on: ubuntu-latest needs: - bump-version + - build-container-image env: ROR_VERSION: ${{ needs.bump-version.outputs.ror_version }} steps: @@ -182,7 +184,6 @@ jobs: - name: Build helm chart run: | - ls -laR ./yq e -i '.version = strenv(ROR_VERSION),.appVersion = strenv(ROR_VERSION)' charts/ror-cluster-agent-v1/Chart.yaml ./yq e -i '.image.tag = strenv(ROR_VERSION)' charts/ror-cluster-agent-v1/values.yaml ./yq e -i '.image.repository = "ncr.sky.nhn.no/ror/cluster-agent"' charts/ror-cluster-agent-v1/values.yaml diff --git a/.github/workflows/agentv2.yml b/.github/workflows/agentv2.yml index fbfb1d4..748b9f8 100644 --- a/.github/workflows/agentv2.yml +++ b/.github/workflows/agentv2.yml @@ -5,6 +5,7 @@ on: paths: - v2/** - .github/workflows/agentv2.yml + - 'charts/ror-cluster-agent-v2/**' # Publish semver tags as releases. #tags: [ 'v*.*.*' ] pull_request: @@ -158,3 +159,34 @@ jobs: # This step uses the identity token to provision an ephemeral certificate # against the sigstore community Fulcio instance. run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} + publish-helm: + runs-on: ubuntu-latest + needs: + - build-container-image + - bump-version + env: + ROR_VERSION: ${{ needs.bump-version.outputs.ror_version }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install helm + uses: azure/setup-helm@v1 + with: + version: v3.15.0 + + - name: install-yq + run: | + wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - | tar xz && mv ${BINARY} yq && chmod +x yq + env: + VERSION: v4.44.5 + BINARY: yq_linux_amd64 + + - name: Build helm chart + run: | + ./yq e -i '.version = strenv(ROR_VERSION),.appVersion = strenv(ROR_VERSION)' charts/ror-cluster-agent-v2/Chart.yaml + ./yq e -i '.image.tag = strenv(ROR_VERSION)' charts/ror-cluster-agent-v2/values.yaml + ./yq e -i '.image.repository = "ncr.sky.nhn.no/ror/cluster-agent"' charts/ror-cluster-agent-v2/values.yaml + helm package charts/ror-cluster-agent-v2 + echo ${{ secrets.GITHUB_TOKEN }} | helm registry login -u ${{ github.actor }} ${{ env.REGISTRY }} --password-stdin + helm push ror-cluster-agent-${ROR_VERSION}.tgz oci://${{ env.REGISTRY }}/norskhelsenett/helm/