Compare commits

...

5 commits

Author SHA1 Message Date
Claire
74ac4908c4 swap helm charts call to GHA - TEST 2023-02-03 17:03:40 -06:00
Claire
08c27753d1 swap helm charts call to GHA - TEST 2023-02-03 17:02:57 -06:00
Claire
a833d6e212 swap helm charts call to GHA - TEST 2023-02-03 16:58:55 -06:00
Claire
b8002af79e swap helm charts call to GHA - TEST 2023-02-03 16:57:43 -06:00
Claire
05b1a41e14 swap helm charts call to GHA 2023-02-03 16:51:43 -06:00

View file

@ -1,17 +1,19 @@
version: 2.1 version: 2.1
orbs: # orbs:
slack: circleci/slack@3.4.2 # slack: circleci/slack@3.4.2
jobs: jobs:
update-helm-charts-index: update-helm-charts-index:
docker: docker:
- image: docker.mirror.hashicorp.services/cimg/go:1.19.2 - image: docker.mirror.hashicorp.services/cimg/go:1.19.2
environment:
CIRCLE_TAG: v0.23.0
steps: steps:
- checkout - checkout
- run: - run:
name: verify Chart version matches tag version name: verify Chart version matches tag version
environment: # environment:
RELEASE_TAG: << pipeline.parameters.release-tag >> # RELEASE_TAG: << pipeline.parameters.release-tag >>
command: | command: |
go install github.com/mikefarah/yq/v2@latest go install github.com/mikefarah/yq/v2@latest
export TAG=${RELEASE_TAG:-$CIRCLE_TAG} export TAG=${RELEASE_TAG:-$CIRCLE_TAG}
@ -22,25 +24,32 @@ jobs:
exit 1 exit 1
fi fi
- run: - run:
name: update helm-charts index name: install gh tool
environment:
RELEASE_TAG: << pipeline.parameters.release-tag >>
command: | command: |
curl --show-error --silent --fail --user "${CIRCLE_TOKEN}:" \ version="2.22.1"
-X POST \ curl --show-error --silent --location --output "gh.tar.gz" "https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_amd64.tar.gz"
-H 'Content-Type: application/json' \ tar -xvzf gh.tar.gz && mkdir -p bin && mv "gh_${version}_linux_amd64/bin/gh" bin/
-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"
- slack/status:
fail_only: true
failure_message: "Failed to trigger an update to the helm charts index. Check the logs at: ${CIRCLE_BUILD_URL}"
parameters: - run:
release-tag: name: update helm-charts index
type: string # environment:
default: "" # RELEASE_TAG: << pipeline.parameters.release-tag >>
description: "The tag to release, including v, e.g. v0.22.1" command: |
export GITHUB_TOKEN="${HELM_CHARTS_GITHUB_TOKEN}"
./bin/gh workflow run .github/workflows/publish-charts.yml \
--repo hashicorp/helm-charts \
--ref templates_default_test \
-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}"
# parameters:
# release-tag:
# type: string
# default: ""
# description: "The tag to release, including v, e.g. v0.22.1"
workflows: workflows:
version: 2 version: 2
@ -49,13 +58,13 @@ workflows:
jobs: jobs:
- update-helm-charts-index: - update-helm-charts-index:
context: helm-charts-trigger-vault context: helm-charts-trigger-vault
filters: # filters:
tags: # tags:
only: /^v.*/ # only: /^v.*/
branches: # branches:
ignore: /.*/ # ignore: /.*/
manual-trigger-update-helm-charts-index: # manual-trigger-update-helm-charts-index:
when: << pipeline.parameters.release-tag >> # when: << pipeline.parameters.release-tag >>
jobs: # jobs:
- update-helm-charts-index: # - update-helm-charts-index:
context: helm-charts-trigger-vault # context: helm-charts-trigger-vault