Skip to content

Commit 4eea48d

Browse files
committed
chore: use standalone cli for pact-broker
1 parent b6fbe95 commit 4eea48d

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ GOARCH = $(shell go env GOARCH)
55
TOOLS_BIN := $(shell pwd)/.bin
66

77
OVERRIDE_GOCI_LINT_V := v1.55.2
8-
SHELL:=env PATH=$(TOOLS_BIN)/go:$(PATH) $(SHELL)
8+
SHELL:=env PATH=$(TOOLS_BIN)/go:$(TOOLS_BIN)/pact/bin:$(PATH) $(SHELL)
99

1010
## tools: Install required tooling.
1111
.PHONY: tools
1212
tools: $(TOOLS_BIN)/golangci-lint $(TOOLS_BIN)/go
1313
$(TOOLS_BIN)/golangci-lint:
1414
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/$(OVERRIDE_GOCI_LINT_V)/install.sh | sh -s -- -b $(TOOLS_BIN)/ $(OVERRIDE_GOCI_LINT_V)
1515

16+
$(TOOLS_BIN)/pact-broker:
17+
@cd $(TOOLS_BIN); curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | PACT_CLI_VERSION=v2.4.4 bash; cd ../
18+
1619
$(TOOLS_BIN)/go:
1720
mkdir -p ${TOOLS_BIN}/go
1821
@cat tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % sh -c 'GOBIN=${TOOLS_BIN}/go go install %'
@@ -64,7 +67,7 @@ contract-test: $(TOOLS_BIN)
6467
@go test -tags=contract ./...
6568

6669
.PHONY: publish-contract
67-
publish-contract:
70+
publish-contract: $(TOOLS_BIN)/pact-broker
6871
./scripts/publish-contract.sh
6972

7073
.PHONY: generate

scripts/publish-contract.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,4 @@ fi
1414
gitCommitSHA=$(git rev-parse HEAD)
1515
gitBranch=$(git rev-parse --abbrev-ref HEAD)
1616

17-
#docker run -v $(pwd)/internal/workspace/2024-05-14/pacts/code-client-go-workspace-service.json:/code-client-go-workspace-service.json --rm \
18-
# -e PACT_BROKER_BASE_URL \
19-
# -e PACT_BROKER_TOKEN \
20-
# pactfoundation/pact-cli:latest \
21-
# publish \
22-
# /code-client-go-workspace-service.json \
23-
# --branch="$gitBranch" \
24-
# --consumer-app-version "$gitCommitSHA"
25-
26-
docker run --rm \
27-
-w ${PWD} \
28-
-v ${PWD}:${PWD} \
29-
-e PACT_BROKER_BASE_URL \
30-
-e PACT_BROKER_TOKEN \
31-
pactfoundation/pact-cli:latest \
32-
publish \
33-
${PWD}/internal/workspace/2024-05-14/pacts/code-client-go-workspace-service.json \
34-
--branch="$gitBranch" \
35-
--consumer-app-version "$gitCommitSHA"
17+
pact-broker publish ./internal/workspace/2024-05-14/pacts/code-client-go-workspace-service.json --consumer-app-version "$gitCommitSHA" --branch="$gitBranch"

0 commit comments

Comments
 (0)