diff --git a/.circleci/config.yml b/.circleci/config.yml index ca48a33..ff52b17 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,17 +1,19 @@ version: 2.1 -orbs: - slack: circleci/slack@3.4.2 +# orbs: +# slack: circleci/slack@3.4.2 jobs: update-helm-charts-index: docker: - image: docker.mirror.hashicorp.services/cimg/go:1.19.2 + environment: + CIRCLE_TAG: v0.23.0 steps: - checkout - run: name: verify Chart version matches tag version - environment: - RELEASE_TAG: << pipeline.parameters.release-tag >> + # environment: + # RELEASE_TAG: << pipeline.parameters.release-tag >> command: | go install github.com/mikefarah/yq/v2@latest export TAG=${RELEASE_TAG:-$CIRCLE_TAG} @@ -22,25 +24,32 @@ jobs: exit 1 fi - run: - name: update helm-charts index - environment: - RELEASE_TAG: << pipeline.parameters.release-tag >> + name: install gh tool 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\": \"${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}" + 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/ -parameters: - release-tag: - type: string - default: "" - description: "The tag to release, including v, e.g. v0.22.1" + - run: + name: update helm-charts index + # environment: + # RELEASE_TAG: << pipeline.parameters.release-tag >> + 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: version: 2 @@ -49,13 +58,13 @@ workflows: jobs: - update-helm-charts-index: context: helm-charts-trigger-vault - 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 + # 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