Skip to content

Commit

Permalink
Parameterised mock API ID in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tomakehurst committed Sep 16, 2024
1 parent 4bfcf65 commit 9e2c50e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- name: Run
env:
WIREMOCK_API_TOKEN: ${{ secrets.WIREMOCK_API_TOKEN }}
run: (cd maven && bash -x ./push-to-wmc.sh ek2z9)
run: (cd maven && bash -x ./push-to-wmc.sh)
8 changes: 3 additions & 5 deletions maven/push-to-wmc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ if [ -z "$WIREMOCK_API_TOKEN" ]; then
exit 1
fi

if [ -z "$1" ]; then
echo "Usage $0 <mock API ID> e.g. $0 ek2z9"
if [ -z "$MOCK_API_ID" ]; then
echo "Environment variable MOCK_API_ID must be set with the target API's ID string e.g. ek2z9"
exit 1
fi

mockApiId=$1

mvn generate-sources
curl "https://api.wiremock.cloud/v1/mock-apis/$mockApiId/__admin/ext/grpc/descriptor" \
curl "https://api.wiremock.cloud/v1/mock-apis/$MOCK_API_ID/__admin/ext/grpc/descriptor" \
-X PUT \
--data-binary @target/generated-resources/protobuf/descriptor-sets/services.dsc \
-H 'content-type:application/octet-stream' \
Expand Down

0 comments on commit 9e2c50e

Please sign in to comment.