Skip to content

Commit 62a53cb

Browse files
committed
chore: update makefile
Signed-off-by: JP-Ellis <josh@jpellis.me>
1 parent 6da9c67 commit 62a53cb

3 files changed

Lines changed: 19 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3131
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
3232
with:
33-
python-version: '3.14'
34-
architecture: 'x64'
33+
python-version: '3.14'
34+
architecture: 'x64'
3535
- run: pip install -r requirements.txt
3636
- name: Test pactflow-example-consumer-python against ${{ matrix.pact_provider }}
3737
run: make test
@@ -48,7 +48,11 @@ jobs:
4848
needs: test
4949
steps:
5050
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
51-
- run: docker pull pactfoundation/pact-cli:latest
51+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
52+
with:
53+
python-version: '3.14'
54+
architecture: 'x64'
55+
- run: pip install -r requirements.txt
5256
- name: Can I deploy?
5357
run: GIT_BRANCH=${GIT_REF:11} make can_i_deploy
5458

@@ -58,7 +62,11 @@ jobs:
5862
needs: can-i-deploy
5963
steps:
6064
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
61-
- run: docker pull pactfoundation/pact-cli:latest
65+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
66+
with:
67+
python-version: '3.14'
68+
architecture: 'x64'
69+
- run: pip install -r requirements.txt
6270
- name: Deploy
6371
run: GIT_BRANCH=${GIT_REF:11} make deploy
6472
if: github.ref == 'refs/heads/master'

Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# It's set as a secure environment variable in the build.yml file
33
PACTICIPANT := "pactflow-example-consumer-python"
44
GITHUB_WEBHOOK_UUID := "04510dc1-7f0a-4ed2-997d-114bfa86f8ad"
5-
PACT_CLI="docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN -e PACT_BROKER_USERNAME -e PACT_BROKER_PASSWORD pactfoundation/pact-cli:latest"
65

76
# Only deploy from master
87
ifeq ($(GIT_BRANCH),master)
@@ -30,7 +29,7 @@ fake_ci: .env
3029
make ci
3130

3231
publish_pacts: .env
33-
@"${PACT_CLI}" publish ${PWD}/pacts --consumer-app-version ${GIT_COMMIT} --branch ${GIT_BRANCH}
32+
pact broker publish ${PWD}/pacts --consumer-app-version ${GIT_COMMIT} --branch ${GIT_BRANCH}
3433

3534
## =====================
3635
## Build/test tasks
@@ -50,7 +49,7 @@ no_deploy:
5049

5150
can_i_deploy: .env
5251
echo "can_i_deploy"
53-
@"${PACT_CLI}" broker can-i-deploy \
52+
pact broker can-i-deploy \
5453
--pacticipant ${PACTICIPANT} \
5554
--version ${GIT_COMMIT} \
5655
--to-environment production \
@@ -61,7 +60,7 @@ deploy_app:
6160
@echo "Deploying to prod"
6261

6362
record_deployment: .env
64-
@"${PACT_CLI}" broker record-deployment --pacticipant ${PACTICIPANT} --version ${GIT_COMMIT} --environment production
63+
pact broker record-deployment --pacticipant ${PACTICIPANT} --version ${GIT_COMMIT} --environment production
6564

6665
## =====================
6766
## PactFlow set up tasks
@@ -80,8 +79,7 @@ create_github_token_secret:
8079
# so that any PRs will get a status that shows what the status of
8180
# the pact is.
8281
create_or_update_github_webhook:
83-
@"${PACT_CLI}" \
84-
broker create-or-update-webhook \
82+
pact broker create-or-update-webhook \
8583
'https://api.github.com/repos/pactflow/example-consumer/statuses/$${pactbroker.consumerVersionNumber}' \
8684
--header 'Content-Type: application/json' 'Accept: application/vnd.github.v3+json' 'Authorization: token $${user.githubCommitStatusToken}' \
8785
--request POST \
@@ -125,4 +123,4 @@ venv:
125123
ln -sf ${CURDIR}/.venv ~/.pyenv/versions/${PROJECT}
126124

127125
@echo "\n$(green)Use it! (populate .python-version)$(sgr0)"
128-
pyenv local ${PROJECT}
126+
pyenv local ${PROJECT}

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Flask==3.1.3
22
pytest==9.0.3
33
requests==2.33.1
4-
pact_python==3.3.1
4+
pact-python==3.3.1
5+
pact-python-cli==2.6.0.0

0 commit comments

Comments
 (0)