From 05b1a41e14a6c0bf115b5e2d62dc4f29ab898533 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Feb 2023 16:51:43 -0600 Subject: [PATCH 1/5] swap helm charts call to GHA --- .circleci/config.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca48a33..c064940 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,17 +21,24 @@ jobs: echo "chart version (${chart_tag}) did not match git version (${git_tag})" exit 1 fi + - run: + name: install gh tool + command: | + version="2.22.1" + curl --show-error --silent --location --output "gh.tar.gz" "https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_amd64.tar.gz" + tar -xvzf gh.tar.gz && mkdir -p bin && mv "gh_${version}_linux_amd64/bin/gh" bin/ + - run: name: update helm-charts index environment: RELEASE_TAG: << pipeline.parameters.release-tag >> command: | - curl --show-error --silent --fail --user "${CIRCLE_TOKEN}:" \ - -X POST \ - -H 'Content-Type: application/json' \ - -H 'Accept: application/json' \ - -d "{\"branch\": \"main\",\"parameters\":{\"SOURCE_REPO\": \"${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}\",\"SOURCE_TAG\": \"${RELEASE_TAG:-$CIRCLE_TAG}\"}}" \ - "${CIRCLE_ENDPOINT}/${CIRCLE_PROJECT}/pipeline" + export GITHUB_TOKEN="${HELM_CHARTS_GITHUB_TOKEN}" + gh workflow run .github/workflows/publish-charts.yml \ + --repo hashicorp/helm-charts \ + --ref main \ + -f SOURCE_TAG="${CIRCLE_TAG}" \ + -f SOURCE_REPO="${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" - slack/status: fail_only: true failure_message: "Failed to trigger an update to the helm charts index. Check the logs at: ${CIRCLE_BUILD_URL}" From b8002af79e4adc194a966a52449d74356267eba1 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Feb 2023 16:57:43 -0600 Subject: [PATCH 2/5] swap helm charts call to GHA - TEST --- .circleci/config.yml | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c064940..ef7369c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,13 @@ version: 2.1 -orbs: - slack: circleci/slack@3.4.2 +# orbs: +# slack: circleci/slack@3.4.2 jobs: update-helm-charts-index: docker: - image: docker.mirror.hashicorp.services/cimg/go:1.19.2 + environment: + CIRCLE_TAG: v0.23.0 steps: - checkout - run: @@ -36,18 +38,18 @@ jobs: export GITHUB_TOKEN="${HELM_CHARTS_GITHUB_TOKEN}" gh workflow run .github/workflows/publish-charts.yml \ --repo hashicorp/helm-charts \ - --ref main \ + --ref templates_default_test \ -f SOURCE_TAG="${CIRCLE_TAG}" \ -f SOURCE_REPO="${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" - - slack/status: - fail_only: true - failure_message: "Failed to trigger an update to the helm charts index. Check the logs at: ${CIRCLE_BUILD_URL}" + # - slack/status: + # fail_only: true + # failure_message: "Failed to trigger an update to the helm charts index. Check the logs at: ${CIRCLE_BUILD_URL}" -parameters: - release-tag: - type: string - default: "" - description: "The tag to release, including v, e.g. v0.22.1" +# parameters: +# release-tag: +# type: string +# default: "" +# description: "The tag to release, including v, e.g. v0.22.1" workflows: version: 2 @@ -56,13 +58,13 @@ workflows: jobs: - update-helm-charts-index: context: helm-charts-trigger-vault - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - manual-trigger-update-helm-charts-index: - when: << pipeline.parameters.release-tag >> - jobs: - - update-helm-charts-index: - context: helm-charts-trigger-vault + # filters: + # tags: + # only: /^v.*/ + # branches: + # ignore: /.*/ + # manual-trigger-update-helm-charts-index: + # when: << pipeline.parameters.release-tag >> + # jobs: + # - update-helm-charts-index: + # context: helm-charts-trigger-vault From a833d6e2121711193b28bfb731dbf1a61a4b184c Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Feb 2023 16:58:55 -0600 Subject: [PATCH 3/5] swap helm charts call to GHA - TEST --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ef7369c..92e5ddc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,11 +45,11 @@ jobs: # fail_only: true # failure_message: "Failed to trigger an update to the helm charts index. Check the logs at: ${CIRCLE_BUILD_URL}" -# parameters: -# release-tag: -# type: string -# default: "" -# description: "The tag to release, including v, e.g. v0.22.1" +parameters: + release-tag: + type: string + default: "" + description: "The tag to release, including v, e.g. v0.22.1" workflows: version: 2 From 08c27753d125565adbbb374b69805990de24d2a0 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Feb 2023 17:02:57 -0600 Subject: [PATCH 4/5] swap helm charts call to GHA - TEST --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 92e5ddc..431158f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,11 +32,11 @@ jobs: - run: name: update helm-charts index - environment: - RELEASE_TAG: << pipeline.parameters.release-tag >> + # environment: + # RELEASE_TAG: << pipeline.parameters.release-tag >> command: | export GITHUB_TOKEN="${HELM_CHARTS_GITHUB_TOKEN}" - gh workflow run .github/workflows/publish-charts.yml \ + ./bin/gh workflow run .github/workflows/publish-charts.yml \ --repo hashicorp/helm-charts \ --ref templates_default_test \ -f SOURCE_TAG="${CIRCLE_TAG}" \ @@ -45,11 +45,11 @@ jobs: # fail_only: true # failure_message: "Failed to trigger an update to the helm charts index. Check the logs at: ${CIRCLE_BUILD_URL}" -parameters: - release-tag: - type: string - default: "" - description: "The tag to release, including v, e.g. v0.22.1" +# parameters: +# release-tag: +# type: string +# default: "" +# description: "The tag to release, including v, e.g. v0.22.1" workflows: version: 2 From 74ac4908c4d97f004619320be0978cc7bdc082dc Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Feb 2023 17:03:40 -0600 Subject: [PATCH 5/5] swap helm charts call to GHA - TEST --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 431158f..ff52b17 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,8 +12,8 @@ jobs: - checkout - run: name: verify Chart version matches tag version - environment: - RELEASE_TAG: << pipeline.parameters.release-tag >> + # environment: + # RELEASE_TAG: << pipeline.parameters.release-tag >> command: | go install github.com/mikefarah/yq/v2@latest export TAG=${RELEASE_TAG:-$CIRCLE_TAG}