Skip to content

Commit

Permalink
Merge pull request #3 from coinbase/patrick/fix-circle
Browse files Browse the repository at this point in the history
Fix CircleCI
  • Loading branch information
patrick-ogrady authored Apr 29, 2020
2 parents 7133323 + fbfb809 commit c3b97c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
validate:
docker:
- image: circleci/node:12
- user: root
user: root
steps:
- checkout
- run: make node-deps
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ go-deps:
deps: node-deps go-deps

gen:
./codegen.sh;
./codegen.sh api.json;

validate:
./validate.sh
./validate.sh;

add-license:
${LICENCE_SCRIPT} .
Expand Down
15 changes: 10 additions & 5 deletions validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ swagger-cli validate api.json;
# Ensure specification includes all changes
./codegen.sh api_test.json;

DIFF_RESULT="$(diff api.json api_test.json)"
EXIT_STATUS=0
if cmp -s api.json api_test.json; then
echo No difference found
else
EXIT_STATUS=$?
echo ERROR ${EXIT_STATUS}: difference detected between api.json and YAML files
fi

# Remove test file
rm api_test.json;

if [ "${DIFF_RESULT}" != 0 ]; then
echo ERROR: difference detected between api.json and YAML files
exit 1
fi
exit "${EXIT_STATUS}"

0 comments on commit c3b97c3

Please sign in to comment.