forked from graphql-java-kickstart/graphql-java-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-build.sh
40 lines (36 loc) · 1.15 KB
/
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
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -ev
echo "current git hash:"
git rev-parse --short HEAD
saveMavenSettings() {
cat >$HOME/.m2/settings.xml <<EOL
<?xml version='1.0' encoding='UTF-8'?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<servers>
<server>
<id>bintray</id>
<username>${BINTRAY_USER}</username>
<password>${BINTRAY_PASS}</password>
</server>
<server>
<id>github</id>
<username>${GITHUB_USER}</username>
<password>${GITHUB_TOKEN}</password>
</server>
</servers>
</settings>
EOL
}
mvn -B verify
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ]; then
saveMavenSettings
git checkout -f ${TRAVIS_BRANCH}
if [ "${RELEASE}" = "true" ]; then
echo "Deploying release to Bintray"
mvn release:clean release:prepare release:perform -B -e -Pbintray
else
echo "Deploy snapshot to Bintray"
mvn deploy -B -Pbintray
fi
fi