Repository navigation
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·91 lines (71 loc) · 5.13 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·91 lines (71 loc) · 5.13 KB
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
91
#!/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/home-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/home-settings.xml versions:set
git commit -am "[Deploy phase] Preparing release"
mvn --settings ~/.m2/home-settings.xml clean deploy -P release
mvn --settings ~/.m2/home-settings.xml scm:tag
echo 'Release deployed'
###########################################################
###########################################################
# Update javadocs
cat << "JAVA_DOC"
██╗ █████╗ ██╗ ██╗ █████╗ ██████╗ ██████╗ ██████╗
██║██╔══██╗██║ ██║██╔══██╗██╔══██╗██╔═══██╗██╔════╝
██║███████║██║ ██║███████║██║ ██║██║ ██║██║
██ ██║██╔══██║╚██╗ ██╔╝██╔══██║██║ ██║██║ ██║██║
╚█████╔╝██║ ██║ ╚████╔╝ ██║ ██║██████╔╝╚██████╔╝╚██████╗
╚════╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═════╝
JAVA_DOC
mvn --settings ~/.m2/home-settings.xml javadoc:aggregate
if [ -d "target/site/apidocs/" ]; then
cd target/site/apidocs/
git init
git remote add javadoc git@github.com:ozimov/seldon.git
git fetch --depth=1 javadoc gh-pages
git add --all
git commit -m "Added docs for current release"
git merge --no-edit -s ours remotes/javadoc/gh-pages
git push javadoc master:gh-pages
rm -r -f .git
cd ../../..
fi
echo 'Javadoc deploy complete'
###########################################################
###########################################################
# next development version
cat << "NEXT_ITERATION"
███╗ ██╗███████╗██╗ ██╗████████╗
████╗ ██║██╔════╝╚██╗██╔╝╚══██╔══╝
██╔██╗ ██║█████╗ ╚███╔╝ ██║
██║╚██╗██║██╔══╝ ██╔██╗ ██║
██║ ╚████║███████╗██╔╝ ██╗ ██║
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝
██╗████████╗███████╗██████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗
██║╚══██╔══╝██╔════╝██╔══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║
██║ ██║ █████╗ ██████╔╝███████║ ██║ ██║██║ ██║██╔██╗ ██║
██║ ██║ ██╔══╝ ██╔══██╗██╔══██║ ██║ ██║██║ ██║██║╚██╗██║
██║ ██║ ███████╗██║ ██║██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║
╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
NEXT_ITERATION
echo "When at prompt, type the SNAPSHOT version (e.g. from 1.0.0 to 1.1.0-SNAPSHOT)\n"
mvn --settings ~/.m2/home-settings.xml versions:set
git commit -am "[Deploy phase] Preparing for next iteration"
# updating origin
git push --force --follow-tags
echo 'Next iteration prepared'