Skip to content
Merged
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
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GITHUB_ORG="pactflow"
PACTICIPANT := "pactflow-example-consumer"
GITHUB_WEBHOOK_UUID := "04510dc1-7f0a-4ed2-997d-114bfa86f8ad"
PACT_CHANGED_WEBHOOK_UUID := "8e49caaa-0498-4cc1-9368-325de0812c8a"
PACT_CLI="docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli:latest"
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"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For users who are looking at this diff who came from the "Deployments and releases" documentation, please note that the PACT_BROKER_FEATURES environment variable is not required any more, and that you should definitely pin your pact-cli version, rather than using latest.

# Only deploy from master
ifeq ($(TRAVIS_BRANCH),master)
Expand Down Expand Up @@ -59,7 +59,7 @@ test_nock: .env
## Deploy tasks
## =====================

deploy: deploy_app tag_as_prod
deploy: deploy_app record_deployment

no_deploy:
@echo "Not deploying as not on master branch"
Expand All @@ -69,16 +69,16 @@ can_i_deploy: .env
@"${PACT_CLI}" broker can-i-deploy \
--pacticipant ${PACTICIPANT} \
--version ${TRAVIS_COMMIT} \
--to prod \
--to-environment production \
--retry-while-unknown 0 \
--retry-interval 10

deploy_app:
@echo "\n========== STAGE: deploy ==========\n"
@echo "Deploying to prod"
@echo "Deploying to production"

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

## =====================
## Pactflow set up tasks
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The project uses a Makefile to simulate a very simple build pipeline with two st
* Check if we are safe to deploy to prod (ie. has the pact content been successfully verified)
* Deploy (only from master)
* Deploy app (just pretend for the purposes of this example!)
* Tag the deployed consumer version as 'prod'
* Record the deployment in the Pact Broker

## Usage

Expand Down