check that git tag == chart tag on tagged releases (#316)
This commit is contained in:
parent
d1ad4ff403
commit
7f7fb7bad0
1 changed files with 44 additions and 26 deletions
|
@ -1,4 +1,7 @@
|
||||||
version: 2
|
version: 2.1
|
||||||
|
orbs:
|
||||||
|
slack: circleci/slack@3.4.2
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bats-unit-test:
|
bats-unit-test:
|
||||||
docker:
|
docker:
|
||||||
|
@ -34,6 +37,17 @@ jobs:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/golang:latest
|
- image: circleci/golang:latest
|
||||||
steps:
|
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:
|
- run:
|
||||||
name: update helm-charts index
|
name: update helm-charts index
|
||||||
command: |
|
command: |
|
||||||
|
@ -43,6 +57,10 @@ jobs:
|
||||||
-H 'Accept: application/json' \
|
-H 'Accept: application/json' \
|
||||||
-d "{\"branch\": \"master\",\"parameters\":{\"SOURCE_REPO\": \"${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}\",\"SOURCE_TAG\": \"${CIRCLE_TAG}\"}}" \
|
-d "{\"branch\": \"master\",\"parameters\":{\"SOURCE_REPO\": \"${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}\",\"SOURCE_TAG\": \"${CIRCLE_TAG}\"}}" \
|
||||||
"${CIRCLE_ENDPOINT}/${CIRCLE_PROJECT}/pipeline"
|
"${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:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
build_and_test:
|
build_and_test:
|
||||||
|
|
Loading…
Reference in a new issue