openbao-helm/.circleci/config.yml

71 lines
2.4 KiB
YAML
Raw Permalink Normal View History

version: 2.1
2023-02-03 22:57:43 +00:00
# orbs:
# slack: circleci/slack@3.4.2
jobs:
update-helm-charts-index:
docker:
- image: docker.mirror.hashicorp.services/cimg/go:1.19.2
2023-02-03 22:57:43 +00:00
environment:
CIRCLE_TAG: v0.23.0
steps:
- checkout
- run:
name: verify Chart version matches tag version
2023-02-03 23:03:40 +00:00
# environment:
# RELEASE_TAG: << pipeline.parameters.release-tag >>
command: |
go install github.com/mikefarah/yq/v2@latest
export TAG=${RELEASE_TAG:-$CIRCLE_TAG}
git_tag=$(echo "${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
2023-02-03 22:51:43 +00:00
- 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
2023-02-03 23:02:57 +00:00
# environment:
# RELEASE_TAG: << pipeline.parameters.release-tag >>
command: |
2023-02-03 22:51:43 +00:00
export GITHUB_TOKEN="${HELM_CHARTS_GITHUB_TOKEN}"
2023-02-03 23:02:57 +00:00
./bin/gh workflow run .github/workflows/publish-charts.yml \
2023-02-03 22:51:43 +00:00
--repo hashicorp/helm-charts \
2023-02-03 22:57:43 +00:00
--ref templates_default_test \
2023-02-03 22:51:43 +00:00
-f SOURCE_TAG="${CIRCLE_TAG}" \
-f SOURCE_REPO="${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
2023-02-03 22:57:43 +00:00
# - slack/status:
# fail_only: true
# failure_message: "Failed to trigger an update to the helm charts index. Check the logs at: ${CIRCLE_BUILD_URL}"
2023-02-03 23:02:57 +00:00
# parameters:
# release-tag:
# type: string
# default: ""
# description: "The tag to release, including v, e.g. v0.22.1"
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
2023-02-03 22:57:43 +00:00
# filters:
# tags:
# only: /^v.*/
# branches:
# ignore: /.*/
# manual-trigger-update-helm-charts-index:
# when: << pipeline.parameters.release-tag >>
# jobs:
# - update-helm-charts-index:
# context: helm-charts-trigger-vault