Skip to content

Commit

Permalink
Merge pull request #140 from teixeira-fernando/improving-pact-flow
Browse files Browse the repository at this point in the history
add to release pipeline the record deployment step
  • Loading branch information
teixeira-fernando authored Aug 29, 2023
2 parents eeb93cf + 69b8d9b commit 06bb757
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,41 @@ jobs:
run: docker image tag ecommerceapp/shipment teixeirafernando/ecommerceapp-shipment:latest
- name: Push Docker Image - shipment
run: docker image push teixeirafernando/ecommerceapp-shipment:latest


pact-record-deployment:

runs-on: ubuntu-latest

env:
PACT_BROKER_URL: ${{ secrets.PACT_BROKER_URL }}
PACT_BROKER_HOST: ${{ secrets.PACT_BROKER_HOST }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
PACT_BROKER_PUBLISH_VERIFICATION_RESULTS: true
GIT_COMMIT: ${{ github.SHA }}

steps:
- name: Download repository
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
- name: Cache
uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Generate test jars for dependencies
run: mvn clean install
- name: Shop Consumer Tests
run: mvn -f shop/ -Dtest=**/contract/*ConsumerPact test -DfailIfNoTests=false
- name: Shipment Consumer Tests
run: mvn -f shipment/ -Dtest=**/contract/*ConsumerPact test -DfailIfNoTests=false
- name: Shop Publish Pacts
run: mvn -f shop/ pact:publish -Dpact.publish.consumer.version=${GIT_COMMIT} -Dpact.publish.consumer.branchName=${{ github.HEAD_REF }} -Dpact.consumer.tags=${{ github.HEAD_REF }} -DtoEnvironment=production
- name: Shipment Publish Pacts
run: mvn -f shipment/ pact:publish -Dpact.publish.consumer.version=${GIT_COMMIT} -Dpact.publish.consumer.branchName=${{ github.HEAD_REF }} -Dpact.consumer.tags=${{ github.HEAD_REF }} -DtoEnvironment=production

0 comments on commit 06bb757

Please sign in to comment.