Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass at publishing pacts for main builds of test splitter client #160

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .buildkite/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ services:
- ~/gomodcache:/gomodcache
working_dir: /work
environment:
- BUILDKITE_BRANCH
- BUILDKITE_COMMIT
- BUILDKITE_JOB_ID
- GOCACHE=/gocache
- GOMODCACHE=/gomodcache
19 changes: 17 additions & 2 deletions .buildkite/pipeline.release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
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:
image: ghcr.io/caarlos0/svu:v2.1.0
entrypoint: ""
command: [".buildkite/steps/prepare-release.sh"]
mount-buildkite-agent: true
- wait

- wait

- name: ":rocket: Release"
artifact_paths: "dist/**/*"
Expand Down
17 changes: 2 additions & 15 deletions .buildkite/steps/publish-pacts.sh
Original file line number Diff line number Diff line change
@@ -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