From 05b1a41e14a6c0bf115b5e2d62dc4f29ab898533 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Feb 2023 16:51:43 -0600 Subject: [PATCH 1/2] 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 ca48a33d4..c06494099 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 82001cd84dde11e483c4d741bcbb7d9ab729fcb3 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Feb 2023 17:19:30 -0600 Subject: [PATCH 2/2] fix path for gh utility --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c06494099..588db5ef6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: 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 main \ -f SOURCE_TAG="${CIRCLE_TAG}" \