Skip to content

Commit

Permalink
chore: allow pact publish script to have custom consumer/provider names
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Mar 10, 2018
1 parent 738bd3a commit d2992cf
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions script/publish.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/sh
function finish {
rm -rf tmp/pact.json
}
trap finish EXIT

consumer=${1:-Foo}
provider=${2:-Bar}
echo $consumer $provider
body=$(cat script/foo-bar.json | sed "s/Foo/${consumer}/" | sed "s/Bar/${provider}/")
echo $body > tmp/pact.json
curl -v -XPUT \-H "Content-Type: application/json" \
-d@script/foo-bar.json \
http://127.0.0.1:9292/pacts/provider/Bar/consumer/Foo/version/1.0.0
-d@tmp/pact.json \
http://127.0.0.1:9292/pacts/provider/${provider}/consumer/${consumer}/version/1.0.0
echo ""

0 comments on commit d2992cf

Please sign in to comment.