-
Notifications
You must be signed in to change notification settings - Fork 1
/
travis.sh
executable file
·59 lines (45 loc) · 1.6 KB
/
travis.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
set -e
# https://www.gnu.org/software/bash/manual/html_node/Pipelines.html
set -o pipefail
# Get the tag for this commit
t=$(git name-rev --tags --name-only $(git rev-parse HEAD));
export MAVEN_OPTS=-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
if test -z "${TRAVIS_TAG}"; then
if test "undefined" != "$t"; then
echo "#";
echo "# Bypass build; there is a tag, $t, that should have triggered a deployment build"
echo "#";
else
echo "#";
echo "# This is an untagged build.";
echo "#";
mvn -B -e clean verify 2>&1 | ./scripts/filter.sh;
fi;
else
if test "undefined" != "$t"; then
cat > ~/.m2/settings.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd/">
<servers>
<server>
<id>bintray</id>
<username>$BINTRAY_USER</username>
<password>$BINTRAY_APIKEY</password>
</server>
</servers>
</settings>
EOF
echo "#";
echo "# This is a tagged build: $t (if successful, artifacts will be deployed under $BINTRAY_USER)";
echo "#";
mvn -B -e deploy 2>&1 | ./scripts/filter.sh;
else
echo "#";
echo "# This should have been a tagged build; however, there is no GIT tag!";
echo "#";
fi;
fi