Created
August 16, 2017 12:07
-
-
Save amatkivskiy/3b16617c2cd4027f90e4882fa21488d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -z "${CI_PULL_REQUEST}" ]]; then | |
echo "---> Making build outside of Pull Request (building single commit or branch)" | |
./gradlew gnagCheck | |
else | |
echo "---> Making build for Pull Request" | |
# In the env variable CI_PULL_REQUEST CircleCI provides the URL of the PR (like https://github.com/amatkivskiy/sample/pull/3) | |
# But for the Gnag task we need PR number (simply 3) | |
# ${CI_PULL_REQUEST##*/} means that we simply get '3' from the URL provided in CI_PULL_REQUEST/ | |
./gradlew gnagReport -PauthToken="${PR_BOT_AUTH_TOKEN}" -PissueNumber="${CI_PULL_REQUEST##*/}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This helped me. Thank you!