Skip to content

Commit 113a602

Browse files
committed
chore: update docs + build
1 parent d967942 commit 113a602

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ WEBHOOK_UUID := "9GS-Z8nSAbUzvJW4xmhdsg"
33
PACT_CHANGED_WEBHOOK_UUID := "c76b601e-d66a-4eb1-88a4-6ebc50c0df8b"
44
PACT_CLI="docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli"
55

6-
# Only deploy from master
7-
ifeq ($(GIT_BRANCH),master)
6+
# Only deploy from main
7+
ifeq ($(GIT_BRANCH),main)
88
DEPLOY_TARGET=deploy
99
else
1010
DEPLOY_TARGET=no_deploy
@@ -43,7 +43,7 @@ fake_ci_webhook:
4343
## =====================
4444

4545
test: .env
46-
./gradlew clean test -i
46+
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` ./gradlew clean test -i
4747

4848
## =====================
4949
## Deploy tasks
@@ -52,7 +52,7 @@ test: .env
5252
deploy: can_i_deploy deploy_app record_deployment
5353

5454
no_deploy:
55-
@echo "Not deploying as not on master branch"
55+
@echo "Not deploying as not on main branch"
5656

5757
can_i_deploy: .env
5858
@"${PACT_CLI}" broker can-i-deploy --pacticipant ${PACTICIPANT} --version ${GIT_COMMIT} --to-environment production
@@ -101,4 +101,4 @@ test_pact_changed_webhook:
101101

102102
schema-test:
103103
# @./node_modules/.bin/swagger-mock-validator ./oas/swagger.yml ../example-consumer-cypress/pacts/example-cypress-consumer-pactflow-example-provider.json
104-
./node_modules/.bin/swagger-mock-validator --user dXfltyFMgNOFZAxr8io9wJ37iUpY42M:O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1 --tag master --provider pactflow-example-provider ./oas/swagger.yml https://test.pactflow.io
104+
./node_modules/.bin/swagger-mock-validator --user dXfltyFMgNOFZAxr8io9wJ37iUpY42M:O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1 --tag main --provider pactflow-example-provider ./oas/swagger.yml https://test.pactflow.io

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
![Build](https://github.com/pactflow/example-provider-springboot/workflows/Build/badge.svg)
44

5-
[![Can I deploy Status](https://test.pactflow.io/pacticipants/pactflow-example-provider-springboot/branches/master/latest-version/can-i-deploy/to-environment/production/badge.svg)](https://test.pactflow.io/overview/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer-java-junit)
5+
[![Can I deploy Status](https://test.pactflow.io/pacticipants/pactflow-example-provider-java-graphql/branches/main/latest-version/can-i-deploy/to-environment/production/badge.svg)](https://test.pactflow.io/overview/provider/pactflow-example-provider-java-graphql/consumer/pactflow-example-consumer-java-junit)
66

7-
[![Pact Status](https://test.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer-java-junit/latest/badge.svg)](https://test.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer-java-junit/latest) (latest pact)
7+
[![Pact Status](https://test.pactflow.io/pacts/provider/pactflow-example-provider-java-graphql/consumer/pactflow-example-consumer-java-junit/latest/badge.svg)](https://test.pactflow.io/pacts/provider/pactflow-example-provider-java-graphql/consumer/pactflow-example-consumer-java-junit/latest) (latest pact)
88

9-
[![Pact Status](https://test.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer-java-junit/latest/prod/badge.svg)](https://test.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer-java-junit/latest/prod) (prod/prod pact)
9+
[![Pact Status](https://test.pactflow.io/pacts/provider/pactflow-example-provider-java-graphql/consumer/pactflow-example-consumer-java-junit/latest/prod/badge.svg)](https://test.pactflow.io/pacts/provider/pactflow-example-provider-java-graphql/consumer/pactflow-example-consumer-java-junit/latest/prod) (prod/prod pact)
1010

1111

1212
This is an example of a Java Spring Boot GraphQL provider that uses Pact, [PactFlow](https://pactflow.io) and GitHub Actions to ensure that it is compatible with the expectations its consumers have of it.
@@ -23,7 +23,7 @@ The project uses a Makefile to simulate a very simple build pipeline with two st
2323
- Run tests (including the pact tests that generate the contract)
2424
- Publish pacts, tagging the consumer version with the name of the current branch
2525
- Check if we are safe to deploy to prod (ie. has the pact content been successfully verified)
26-
- Deploy (only from master)
26+
- Deploy (only from main)
2727
- Deploy app (just pretend for the purposes of this example!)
2828
- Tag the deployed consumer version as 'prod'
2929

@@ -32,7 +32,8 @@ The project uses a Makefile to simulate a very simple build pipeline with two st
3232
- Docker
3333
- A [PactFlow](https://pactflow.io) account
3434
- A [read/write API Token](https://docs.pactflow.io/#configuring-your-api-token) from your PactFlow account
35-
- Java 8+ installed
35+
- Java 19+ installed
36+
- A linux based environment (e.g. MacOSX, Linux, Windows Subsystem for Linux)
3637

3738
## Usage
3839

src/test/java/com/example/springboot/ProductsPactTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@ExtendWith(SpringExtension.class)
1919
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
2020
@Provider("pactflow-example-provider-java-graphql")
21-
@PactBroker(scheme = "https", host = "${PACT_BROKER_HOST}", providerBranch = "${GIT_COMMIT}", enablePendingPacts = "true", authentication = @PactBrokerAuth(token = "${PACT_BROKER_TOKEN}"))
21+
@PactBroker(scheme = "https", host = "${PACT_BROKER_HOST}", providerBranch = "${GIT_BRANCH}", enablePendingPacts = "true", authentication = @PactBrokerAuth(token = "${PACT_BROKER_TOKEN}"))
2222
class ProductsPactTest {
2323

2424
@Autowired

0 commit comments

Comments
 (0)