swap helm charts call to GHA (#840)

* swap helm charts call to GHA

* fix path for gh utility
This commit is contained in:
claire labry 2023-02-03 17:41:49 -06:00 committed by GitHub
parent 72914d873c
commit a4e076b132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,17 +21,24 @@ jobs:
echo "chart version (${chart_tag}) did not match git version (${git_tag})" echo "chart version (${chart_tag}) did not match git version (${git_tag})"
exit 1 exit 1
fi 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: - run:
name: update helm-charts index name: update helm-charts index
environment: environment:
RELEASE_TAG: << pipeline.parameters.release-tag >> RELEASE_TAG: << pipeline.parameters.release-tag >>
command: | command: |
curl --show-error --silent --fail --user "${CIRCLE_TOKEN}:" \ export GITHUB_TOKEN="${HELM_CHARTS_GITHUB_TOKEN}"
-X POST \ ./bin/gh workflow run .github/workflows/publish-charts.yml \
-H 'Content-Type: application/json' \ --repo hashicorp/helm-charts \
-H 'Accept: application/json' \ --ref main \
-d "{\"branch\": \"main\",\"parameters\":{\"SOURCE_REPO\": \"${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}\",\"SOURCE_TAG\": \"${RELEASE_TAG:-$CIRCLE_TAG}\"}}" \ -f SOURCE_TAG="${CIRCLE_TAG}" \
"${CIRCLE_ENDPOINT}/${CIRCLE_PROJECT}/pipeline" -f SOURCE_REPO="${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
- slack/status: - slack/status:
fail_only: true fail_only: true
failure_message: "Failed to trigger an update to the helm charts index. Check the logs at: ${CIRCLE_BUILD_URL}" failure_message: "Failed to trigger an update to the helm charts index. Check the logs at: ${CIRCLE_BUILD_URL}"