forked from RutledgePaulV/prune
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.sh
executable file
·66 lines (56 loc) · 1.55 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
#!/usr/bin/env bash
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 remote update
git pull --all
git reset --hard origin/develop
echo "Creating the release branch"
mvn 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 jgitflow:release-finish -DnoReleaseBuild=true -DpushReleases=true -DnoDeploy=true
echo "Checking out latest version of master."
git remote update
git pull --all
git checkout origin/master
echo "Deploying new release artifacts to sonatype repository."
mvn clean deploy -P release
fi
}
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 remote update
git pull --all
git reset --hard origin/develop
echo "Deploying new snapshot artifacts to sonatype repository."
mvn clean deploy -P release
fi
}
function test() {
mvn clean test
}
case "$1" in
snapshot)
echo -n "Preparing to release a new snapshot version..."
snapshot
echo ""
;;
release)
echo -n "Preparing to release a new version..."
release
echo ""
;;
test)
echo -n "Running tests..."
test
echo ""
;;
*)
echo "Usage: ./manage.sh release|snapshot|test"
exit 1
esac