45 lines
1.6 KiB
YAML
45 lines
1.6 KiB
YAML
version: 2.1
|
|
orbs:
|
|
slack: circleci/slack@3.4.2
|
|
|
|
jobs:
|
|
update-helm-charts-index:
|
|
docker:
|
|
- image: docker.mirror.hashicorp.services/golang:1.19.2
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: verify Chart version matches tag version
|
|
command: |
|
|
GO111MODULE=on go get github.com/mikefarah/yq/v2
|
|
git_tag=$(echo "${CIRCLE_TAG#v}")
|
|
chart_tag=$(yq r Chart.yaml version)
|
|
if [ "${git_tag}" != "${chart_tag}" ]; then
|
|
echo "chart version (${chart_tag}) did not match git version (${git_tag})"
|
|
exit 1
|
|
fi
|
|
- run:
|
|
name: update helm-charts index
|
|
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\": \"${CIRCLE_TAG}\"}}" \
|
|
"${CIRCLE_ENDPOINT}/${CIRCLE_PROJECT}/pipeline"
|
|
- slack/status:
|
|
fail_only: true
|
|
failure_message: "Failed to trigger an update to the helm charts index. Check the logs at: ${CIRCLE_BUILD_URL}"
|
|
|
|
workflows:
|
|
version: 2
|
|
# Note: unit and acceptance tests are now being run in GitHub Actions
|
|
update-helm-charts-index:
|
|
jobs:
|
|
- update-helm-charts-index:
|
|
context: helm-charts-trigger-vault
|
|
filters:
|
|
tags:
|
|
only: /^v.*/
|
|
branches:
|
|
ignore: /.*/
|