@@ -4,11 +4,12 @@ unset JOVL_VERSION KZOP_VERSION BUILD_SCRIPT_DIR
4
4
KZOP_REPO=" http://localhost:8000"
5
5
JOVL_REPO=" http://localhost:8000"
6
6
PUBLISH=false
7
+ LATEST=false
7
8
HELP=false
8
9
9
10
function getargs() {
10
- longopts=" jovl-version:,kzop-version:,kzop-repo:,jovl-repo:,publish,build-scripts:,help"
11
- shortopts=" j:k:K:J:pb:h "
11
+ longopts=" jovl-version:,kzop-version:,kzop-repo:,jovl-repo:,publish,build-scripts:,latest, help"
12
+ shortopts=" j:k:K:J:pb:lh "
12
13
progname=$( basename " $0 " )
13
14
OPTS=$( getopt -n " $progname " -o " $shortopts " --long " $longopts " -- " $@ " )
14
15
if [[ $? -ne 0 ]] ; then
@@ -29,6 +30,8 @@ function getargs() {
29
30
PUBLISH=true ; shift ;;
30
31
-b|--build-scripts)
31
32
BUILD_SCRIPT_DIR=" $2 " ; shift 2 ;;
33
+ -l|--latest)
34
+ LATEST=true ; shift ;;
32
35
-h|--help)
33
36
HELP=true ; shift ;;
34
37
--)
@@ -44,6 +47,10 @@ function getargs() {
44
47
echo " Must specify build-script directory with -b or --build-scripts option if publishing"
45
48
return 1
46
49
fi
50
+ if $LATEST && ! $PUBLISH ; then
51
+ echo " Must specify --publish if --latest is used"
52
+ return 1
53
+ fi
47
54
if [[ -z $JOVL_VERSION || -z $KZOP_VERSION ]] ; then
48
55
if [[ -z $KZOP_VERSION ]] ; then
49
56
echo " Must specify KaiZen OpenApiParser version with -k or --kzop-version option"
@@ -72,8 +79,10 @@ function usage() {
72
79
-p or --publish - publish the newly built update site
73
80
* -b or --build-scripts - speicfy location of RepreZen build scripts, including
74
81
the "publish" script. This is required only if "-p" is specified
82
+ -l or --latest - publish to "latest" site in addition to site named for
83
+ version (--publish must also be specified)
75
84
-h or --help - print this message and do nothing else
76
-
85
+
77
86
Note on repos: Both ---kzop-repo and --jovl-repo default to
78
87
http://localhost:8000, so if you already have the needed versions in
79
88
your local maven repo cache, you can set up a simple HTTP server to
@@ -93,6 +102,9 @@ function main() {
93
102
buildSite
94
103
if $PUBLISH ; then
95
104
publishSite
105
+ if $LATEST ; then
106
+ publishLatest
107
+ fi
96
108
fi
97
109
}
98
110
@@ -110,14 +122,23 @@ function buildSite() {
110
122
}
111
123
112
124
function publishSite() {
125
+ publish " $KZOP_VERSION "
126
+ }
127
+
128
+ function publishLatest() {
129
+ publish " latest"
130
+ }
131
+
132
+ function publish() {
113
133
local pub=" $BUILD_SCRIPT_DIR /publish"
114
- " $pub " -w -c -d " $KZOP_VERSION " \
134
+ " $pub " -w -c -d " $1 " \
115
135
--ws-host wsw \
116
136
--ws-root /data/products/kaizen/openapi-parser/updates \
117
137
--local-root target/repository \
118
138
\*
119
139
120
140
}
141
+
121
142
if ! getargs " $@ " ; then
122
143
usage
123
144
exit 1
0 commit comments