Skip to content

Commit 972bf83

Browse files
committed
feat: update to use record-deployment instead of tagging as prod
1 parent b16e204 commit 972bf83

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ GITHUB_ORG="pactflow"
44
PACTICIPANT := "pactflow-example-consumer"
55
GITHUB_WEBHOOK_UUID := "04510dc1-7f0a-4ed2-997d-114bfa86f8ad"
66
PACT_CHANGED_WEBHOOK_UUID := "8e49caaa-0498-4cc1-9368-325de0812c8a"
7-
PACT_CLI="docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli:latest"
7+
PACT_CLI="docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN -e PACT_BROKER_FEATURES=deployments pactfoundation/pact-cli:0.46.1.0"
88

99
# Only deploy from master
1010
ifeq ($(TRAVIS_BRANCH),master)
@@ -59,7 +59,7 @@ test_nock: .env
5959
## Deploy tasks
6060
## =====================
6161

62-
deploy: deploy_app tag_as_prod
62+
deploy: deploy_app record_deployment
6363

6464
no_deploy:
6565
@echo "Not deploying as not on master branch"
@@ -69,16 +69,16 @@ can_i_deploy: .env
6969
@"${PACT_CLI}" broker can-i-deploy \
7070
--pacticipant ${PACTICIPANT} \
7171
--version ${TRAVIS_COMMIT} \
72-
--to prod \
72+
--to-environment production \
7373
--retry-while-unknown 0 \
7474
--retry-interval 10
7575

7676
deploy_app:
7777
@echo "\n========== STAGE: deploy ==========\n"
78-
@echo "Deploying to prod"
78+
@echo "Deploying to production"
7979

80-
tag_as_prod: .env
81-
@"${PACT_CLI}" broker create-version-tag --pacticipant ${PACTICIPANT} --version ${TRAVIS_COMMIT} --tag prod
80+
record_deployment: .env
81+
@"${PACT_CLI}" broker record_deployment --pacticipant ${PACTICIPANT} --version ${TRAVIS_COMMIT} --environment production
8282

8383
## =====================
8484
## Pactflow set up tasks

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The project uses a Makefile to simulate a very simple build pipeline with two st
1818
* Check if we are safe to deploy to prod (ie. has the pact content been successfully verified)
1919
* Deploy (only from master)
2020
* Deploy app (just pretend for the purposes of this example!)
21-
* Tag the deployed consumer version as 'prod'
21+
* Record the deployment in the Pact Broker
2222

2323
## Usage
2424

0 commit comments

Comments
 (0)