1
0
mirror of https://github.com/ru-de/faq.git synced 2024-11-22 10:22:20 +00:00

Better ci (#393)

* fix ci

* test

* test

* test2

* verbose

* add pr check

* revert
This commit is contained in:
Evgeniy Sokolov 2018-05-13 23:34:43 +02:00 committed by GitHub
parent 2ab976572e
commit 80d38abc36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -15,7 +15,7 @@ install:
script: script:
- bash files/run_on_master.sh - bash files/run_on_master.sh
- git checkout $TRAVIS_COMMIT - git checkout $TRAVIS_COMMIT -qf
- bash files/check.sh - bash files/check.sh
notifications: notifications:

View File

@ -1,5 +1,10 @@
#!/bin/bash #!/bin/bash
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
echo "Skip, because not a PR"
exit 0
fi
DIR=`dirname $0` DIR=`dirname $0`
git config --global core.quotepath false git config --global core.quotepath false
@ -31,16 +36,14 @@ jq -s '[.[][]]' /tmp/comments.json > /tmp/comments_array.json
cat /tmp/comments_array.json cat /tmp/comments_array.json
[ "${TRAVIS_PULL_REQUEST}" != "false" ] || exit 0
curl -s https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST/comments > /tmp/pr_comments.json
github_comments_diff -comments /tmp/comments_array.json -exists-comments /tmp/pr_comments.json > /tmp/send_comments.json
OUTPUT=$(cat /tmp/comments_array.json | grep "\[]"); OUTPUT=$(cat /tmp/comments_array.json | grep "\[]");
EXIT_CODE=$? EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then if [ $EXIT_CODE -ne 0 ]; then
curl -s https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST/comments > /tmp/pr_comments.json
github_comments_diff -comments /tmp/comments_array.json -exists-comments /tmp/pr_comments.json > /tmp/send_comments.json
github_comments_send -file /tmp/send_comments.json -repo $TRAVIS_REPO_SLUG -pr $TRAVIS_PULL_REQUEST github_comments_send -file /tmp/send_comments.json -repo $TRAVIS_REPO_SLUG -pr $TRAVIS_PULL_REQUEST
fi fi