Skip to content

Commit 6276690

Browse files
committed
added can I deploy script to publish-pacts.sh
1 parent b754d16 commit 6276690

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

publish-pacts.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,22 @@ pact-broker create-version-tag \
3333
--tag "$PACT_ENV" \
3434
--broker-base-url "$PACT_BROKER_URL" \
3535
--broker-token "$PACT_BROKER_TOKEN"
36+
37+
# Can-I-Deploy check
38+
echo "Running can-i-deploy check for provider compatibility..."
39+
pact-broker can-i-deploy \
40+
--pacticipant "VPCourtScheduleProvider" \
41+
--version "$GIT_COMMIT" \
42+
--to-environment "$PACT_ENV" \
43+
--broker-base-url "$PACT_BROKER_URL" \
44+
--broker-token "$PACT_BROKER_TOKEN" \
45+
--output table
46+
47+
CAN_I_DEPLOY_STATUS=$?
48+
49+
if [ "$CAN_I_DEPLOY_STATUS" -ne 0 ]; then
50+
echo "❌ Can-I-Deploy failed — this version is NOT safe to deploy to $PACT_ENV."
51+
exit 1
52+
else
53+
echo "✅ Can-I-Deploy succeeded — this version is safe to deploy to $PACT_ENV."
54+
fi

0 commit comments

Comments
 (0)