forked from ngageoint/mrgeo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy
executable file
·39 lines (29 loc) · 967 Bytes
/
deploy
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
#!/bin/bash
# Get the existing version of the build
VERSION=`scripts/mvn-build --quiet help:evaluate -Dexpression=project.version $@ | grep -v '\[' | tail -1`
echo "VERSION" $VERSION
# Get the build type
BUILD=`scripts/mvn-build --quiet help:evaluate -Dexpression=final.classifier $@ | grep -v '\[' | tail -1`
echo "BUILD" $BUILD
# Check for SNAPSHOT, and add the BUILD as part of the version name
if [[ $VERSION == *"-SNAPSHOT" ]]; then
echo "have snapshot"
NEWVERSION=${VERSION%"-SNAPSHOT"}-$BUILD-SNAPSHOT
else
echo "no snapshot"
NEWVERSION=${VERSION}-$BUILD
fi
#echo $NEWVERSION
# Do a build first, to make sure everything works OK
#scripts/mvn-build build $@
# Set the new version
scripts/mvn-build $@ version $NEWVERSION
if [ $? -eq 0 ]; then
# Do a clean
scripts/mvn-build clean $@
# Do the deploy
scripts/mvn-build deploy $@
fi
# always do this step
# Set the version back to the original
scripts/mvn-build $@ version revert