-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·29 lines (27 loc) · 874 Bytes
/
build.sh
File metadata and controls
executable file
·29 lines (27 loc) · 874 Bytes
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
#!/bin/bash
# Determine Maven goal
# Behaviour can be overridden by exporting the MVN_GOAL variable
if [ ! -z "${MVN_GOAL}" ]
then
echo "Using goal from MVN_GOAL variable: ${MVN_GOAL}"
else
#by default, use "install"
MVN_GOAL="install"
#check if nexus credentials are set
if [ -z "${NEXUS_DEPLOY_USERNAME}" ] || [ -z "${NEXUS_DEPLOY_PASSWORD}" ]
then
echo "Nexus credentials not set. Skipping Maven deployment!"
else
#if snapshot OR tag, deploy
if [ ! -z "${TRAVIS_TAG}" ] || (head -n 10 pom.xml | egrep -q "<version>.*SNAPSHOT</version>")
then
MVN_GOAL="deploy"
if [[ "${TRAVIS_TAG}" ]]; then
mvn versions:set -DnewVersion="${TRAVIS_TAG}" versions:commit
fi
else
echo "Not a snapshot release or tagged revision. Skipping Maven deployment!"
fi
fi
fi
mvn ${MVN_GOAL} $@