forked from ozimov/embedded-redis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·58 lines (46 loc) · 3.62 KB
/
release.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
#!/bin/bash
# Deploy maven artifact in current directory into Maven central repository
# using maven-release-plugin goals
###########################################################
###########################################################
cat << "RELEASE"
██████╗ ███████╗██╗ ███████╗ █████╗ ███████╗███████╗
██╔══██╗██╔════╝██║ ██╔════╝██╔══██╗██╔════╝██╔════╝
██████╔╝█████╗ ██║ █████╗ ███████║███████╗█████╗
██╔══██╗██╔══╝ ██║ ██╔══╝ ██╔══██║╚════██║██╔══╝
██║ ██║███████╗███████╗███████╗██║ ██║███████║███████╗
╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝
RELEASE
set -e
mvn --settings ~/.m2/settings.xml scm:check-local-modification
# release
echo "\n----------------------------------------"
echo "When at prompt, type the release version (e.g. from 1.0-SNAPSHOT to 1.0)\n"
mvn --settings ~/.m2/settings.xml versions:set
git commit -am "[Deploy phase] Preparing release"
mvn --settings ~/.m2/settings.xml clean deploy -DskipTests -P release
mvn --settings ~/.m2/settings.xml scm:tag
echo 'Release deployed'
###########################################################
###########################################################
# next development version
cat << "NEXT_ITERATION"
███╗ ██╗███████╗██╗ ██╗████████╗
████╗ ██║██╔════╝╚██╗██╔╝╚══██╔══╝
██╔██╗ ██║█████╗ ╚███╔╝ ██║
██║╚██╗██║██╔══╝ ██╔██╗ ██║
██║ ╚████║███████╗██╔╝ ██╗ ██║
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝
██╗████████╗███████╗██████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗
██║╚══██╔══╝██╔════╝██╔══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║
██║ ██║ █████╗ ██████╔╝███████║ ██║ ██║██║ ██║██╔██╗ ██║
██║ ██║ ██╔══╝ ██╔══██╗██╔══██║ ██║ ██║██║ ██║██║╚██╗██║
██║ ██║ ███████╗██║ ██║██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║
╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
NEXT_ITERATION
echo "When at prompt, type the SNAPSHOT version (e.g. from 1.0 to 2.0-SNAPSHOT)\n"
mvn --settings ~/.m2/settings.xml versions:set
git commit -am "[Deploy phase] Preparing for next iteration"
# updating origin
git push --force --follow-tags
echo 'Next iteration prepared'