forked from graphql-java-kickstart/graphql-java-servlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-build.sh
30 lines (27 loc) · 841 Bytes
/
travis-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -ev
saveGitCredentials() {
cat >$HOME/.netrc <<EOL
machine github.com
login ${GITHUB_USERNAME}
password ${GITHUB_TOKEN}
machine api.github.com
login ${GITHUB_USERNAME}
password ${GITHUB_TOKEN}
EOL
chmod 600 $HOME/.netrc
}
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ]; then
saveGitCredentials
git checkout -f ${TRAVIS_BRANCH}
if [ "${RELEASE}" = "true" ]; then
echo "Deploying release to Bintray"
# ./gradlew clean assemble release -Prelease.useAutomaticVersion=true && ./gradlew check --info
./gradlew clean assemble && ./gradlew check --info && ./gradlew bintrayUpload -x check --info
else
echo "Deploying snapshot to Bintray"
./gradlew artifactoryPublish && ./gradlew check --info
fi
else
./gradlew check --info
fi