Skip to content

Commit

Permalink
Add build CICD for provider mock
Browse files Browse the repository at this point in the history
  • Loading branch information
forgetso committed Apr 26, 2024
1 parent ee301eb commit f94febd
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/provider_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
# create the provider image for AMD64
- name: Build the Provider Container
id: build_docker_provider_amd64
continue-on-error: true
continue-on-error: false
uses: docker/build-push-action@v5
with:
context: ${{github.workspace}}
Expand All @@ -130,7 +130,7 @@ jobs:
# create the provider image for ARM64
- name: Build the Provider Container
id: build_docker_provider_arm64
continue-on-error: true
continue-on-error: false
uses: docker/build-push-action@v5
with:
context: ${{github.workspace}}
Expand All @@ -157,3 +157,30 @@ jobs:
docker logs $CONTAINER >& provider.log
echo $(cat provider.log)
grep -oE "Version: \".*\"" provider.log || (echo $(cat provider.log) && exit 1)
# create the provider mock image for AMD64
- name: Build the Provider Mock Container
id: build_docker_provider_mock_amd64
continue-on-error: false
uses: docker/build-push-action@v5
with:
context: ${{github.workspace}}
file: ${{github.workspace}}/docker/images/provider.mock.dockerfile
platforms: linux/amd64
push: false
tags: prosopo/provider-mock:dev
outputs: type=docker,dest=provider-mock-amd64.tar

# load the provider-mock AMD64 image
- name: Load the Provider Container
run: docker load -i provider-mock-amd64.tar

# Check that the version command works when running the bundle in the provider image
- name: Check provider mock container runs
run: |
CONTAINER=$(docker run -p 9229:9229 prosopo/provider-mock:dev')
sleep 10s
docker logs $CONTAINER >& provider-mock.log
echo $(cat provider.log)
RESPONSE=$(curl --location 'http://localhost:9229/v1/prosopo/provider/verify' --header 'Content-Type: application/json' --data '{"user": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY","dapp": "5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM","blockNumber": 1}'| jq --raw-output '.status')
if [ "$RESPONSE" = "User verified" ]; then exit 0; else exit 1; fi

0 comments on commit f94febd

Please sign in to comment.