swap helm charts call to GHA

This commit is contained in:
Claire 2023-02-03 16:51:43 -06:00
parent 72914d873c
commit 05b1a41e14

View file

@ -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}"