Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #473 from hashicorp/ci/check-version-tag
Browse files Browse the repository at this point in the history
check that git tag == chart tag on tagged releases
  • Loading branch information
alvin-huang authored May 28, 2020
2 parents 627c7ae + cb7367a commit 2af3cb6
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version: 2
version: 2.1
orbs:
slack: circleci/[email protected]

jobs:
unit:
docker:
Expand Down Expand Up @@ -42,6 +45,17 @@ jobs:
docker:
- image: circleci/golang:latest
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: |
Expand All @@ -51,6 +65,9 @@ jobs:
-H 'Accept: application/json' \
-d "{\"branch\": \"master\",\"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
Expand Down

0 comments on commit 2af3cb6

Please sign in to comment.