forked from RutledgePaulV/rest-query-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmanage.sh
executable file
·90 lines (75 loc) · 2.4 KB
/
manage.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
function unit_tests() {
mvn clean test
}
function integration_test() {
mvn clean install failsafe:integration-test
}
function snapshot() {
read -p "This will reset your current working tree to origin/develop, is this okay? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
git fetch
git reset --hard origin/develop
echo "Deploying new release artifacts to sonatype repository."
mvn clean deploy -P release
fi
}
function release() {
read -p "This will reset your current working tree to origin/develop, is this okay? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
git fetch
git reset --hard origin/develop
echo "Creating the release branch"
mvn -Prelease jgitflow:release-start -DpushReleases=true -DautoVersionSubmodules=true
echo "Merging the release branch into develop & master, pushing changes, and tagging new version off of master"
mvn -Prelease jgitflow:release-finish -DnoReleaseBuild=true -DpushReleases=true -DnoDeploy=true
echo "Checking out latest version of master."
git fetch
git checkout origin/master
echo "Deploying new release artifacts to sonatype repository."
mvn clean deploy -P release
fi
}
function upgrade_dependencies() {
echo "Checking for a newer version of a parent pom.xml file"
mvn versions:update-parent
echo "Updating all pom.xml files to the latest available from their respective repositories. No changes will be committed."
mvn versions:use-latest-releases
echo "Checking for properties used to manage dependency versions and updating them as well. No changes will be committed."
mvn versions:update-properties
}
case "$1" in
integration-test)
echo -n "Starting integration tests..."
integration_test
echo ""
;;
snapshot)
echo -n "Preparing a new snapshot version of the app..."
snapshot
echo ""
;;
release)
echo -n "Preparing to release a new version of the app..."
release
echo ""
;;
unit-test)
echo "Starting unit tests..."
unit_tests
echo ""
;;
upgrade)
echo -n "Checking for new versions of dependencies..."
upgrade_dependencies
echo ""
;;
*)
echo "Usage: ./manage.sh integration-test|release|snapshot|unit-test|upgrade"
exit 1
esac
exit 0