forked from strolch-li/strolch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·63 lines (49 loc) · 1.36 KB
/
deploy.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
#!/bin/bash
# Your mvn settings.xml:
#
# <settings>
# <servers>
# <server>
# <id>oss.sonatype.org</id>
# <username>...</username>
# <password>...</password>
# </server>
# </servers>
# </settings>
#
# usage
if [ $# != 1 ] ; then
echo -e "Usage: ${0} <version>"
exit 1
fi
# Confirm
releaseVersion=${1}
echo -e "INFO: Do you want to deploy version ${releaseVersion} to Maven Central? y/n"
read a
if [[ "${a}" != "y" && "${a}" != "Y" ]] ; then
exit 0;
fi
# Verify tag
echo -e "\nINFO: Verifying tag ${releaseVersion}\n\n"
if ! git tag --verify ${releaseVersion} ; then
echo -e "ERROR: Failed to verify tag ${releaseVersion}"
exit 1
fi
echo
echo
# Checkout tag
echo -e "\nINFO: Checking out tag ${releaseVersion}"
if ! git checkout ${releaseVersion} ; then
echo -e "ERROR: Failed to checkout tag ${releaseVersion}"
exit 1
fi
# Build and deploy
echo -e "\nINFO: Building and deploying to Maven Central..."
if ! mvn clean deploy -DskipTests -Pdeploy > /dev/null ; then
echo -e "ERROR: Failed to build and deploy to Maven Central!"
exit 1
fi
echo -e "\nINFO: Strolch release ${releaseVersion} deployed to Maven Central."
echo -e "INFO: Remember, it can take up to 10minutes to be available, and 2 hours for all synching."
echo -e "\nRepository is at: https://oss.sonatype.org/service/local/repositories/releases/content/li/strolch/"
exit 0