generated from hmcts/service-hmcts-crime-springboot-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpublish-pacts.sh
More file actions
executable file
·35 lines (29 loc) · 848 Bytes
/
publish-pacts.sh
File metadata and controls
executable file
·35 lines (29 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Load env vars from .env if available
if [ -f .env ]; then
set -a
source .env
set +a
fi
# Export Git metadata
export GIT_COMMIT=$(git rev-parse HEAD)
if [ -n "$GIT_BRANCH" ]; then
BRANCH_NAME="$GIT_BRANCH"
else
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
fi
export GIT_BRANCH="$BRANCH_NAME"
# Run provider verification with results published
./gradlew test \
-Dpact.provider.version="$GIT_COMMIT" \
-Dpact.verifier.publishResults=true \
-Dpact.provider.branch="$GIT_BRANCH" \
-DPACT_BROKER_TOKEN="$PACT_BROKER_TOKEN" \
-DPACT_BROKER_HOST="$PACT_BROKER_URL"
# Optional: tag provider in the broker
pact-broker create-version-tag \
--pacticipant "VPCourtSchedulePactProvider" \
--version "$GIT_COMMIT" \
--tag "$PACT_ENV" \
--broker-base-url "$PACT_BROKER_URL" \
--broker-token "$PACT_BROKER_TOKEN"