diff --git a/.buildkite/docker-compose.yml b/.buildkite/docker-compose.yml index 85985f9e..31fcbd94 100644 --- a/.buildkite/docker-compose.yml +++ b/.buildkite/docker-compose.yml @@ -11,6 +11,8 @@ services: - ~/gomodcache:/gomodcache working_dir: /work environment: + - BUILDKITE_BRANCH + - BUILDKITE_COMMIT - BUILDKITE_JOB_ID - GOCACHE=/gocache - GOMODCACHE=/gomodcache diff --git a/.buildkite/pipeline.release.yml b/.buildkite/pipeline.release.yml index c28183e9..20d470ee 100644 --- a/.buildkite/pipeline.release.yml +++ b/.buildkite/pipeline.release.yml @@ -1,4 +1,19 @@ steps: + - name: ":banana: Publish Pact" + env: + PACT_BROKER_BASE_URL: "https://buildkite.pactflow.io" + plugins: + - aws-ssm#v1.0.0: + parameters: + PACT_BROKER_TOKEN: /pipelines/buildkite/test-splitter-client-release/PACT_BROKER_TOKEN + - docker#v5.11.0: + image: pactfoundation/pact-cli:latest + command: ["./buildkite/steps/publish-pacts.sh"] + environment: + - BUILDKITE_COMMIT + - PACT_BROKER_BASE_URL + - PACT_BROKER_TOKEN + - name: ":cook: Prepare release" plugins: - docker#v5.11.0: @@ -6,8 +21,8 @@ steps: entrypoint: "" command: [".buildkite/steps/prepare-release.sh"] mount-buildkite-agent: true - - - wait + + - wait - name: ":rocket: Release" artifact_paths: "dist/**/*" diff --git a/.buildkite/steps/publish-pacts.sh b/.buildkite/steps/publish-pacts.sh index d17d42a7..4ba3cad3 100755 --- a/.buildkite/steps/publish-pacts.sh +++ b/.buildkite/steps/publish-pacts.sh @@ -1,16 +1,3 @@ -#!/usr/bin/env sh +#!bash -eux -set -euo pipefail - -echo -e "--- :download: Fetching pacts" -buildkite-agent artifact download internal/api/pacts/* . - -export PACT_BROKER_BASE_URL=https://buildkite.pactflow.io - -echo -e "--- :upload: Uploading pacts" -pact \ - publish \ - internal/api/pacts \ - --branch ${BUILDKITE_BRANCH} \ - --consumer-app-version ${BUILDKITE_COMMIT} \ - --tag-with-git-branch +publish internal/api/pacts --consumer-app-version $BUILDKITE_BUILD_NUMBER