Skip to content

Commit 750388d

Browse files
committed
Add release-versions.txt file
1 parent 614bf66 commit 750388d

File tree

2 files changed

+42
-9
lines changed

2 files changed

+42
-9
lines changed
Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,49 @@
1-
#!/bin/sh
1+
#!/bin/bash
2+
3+
. $(pwd)/release-versions.txt
24

35
MESSAGE=$(git log -1 --pretty=%B)
46
./mvnw clean buildnumber:create pre-site
57

68
./mvnw javadoc:javadoc
79

10+
RELEASE_VERSION=$(cat pom.xml | grep -oPm1 "(?<=<version>)[^<]+")
11+
812
# Concourse does shallow clones, so need the next 2 commands to have the gh-pages branch
913
git remote set-branches origin 'gh-pages'
1014
git fetch -v
15+
1116
git checkout gh-pages
12-
mkdir -p snapshot/htmlsingle
13-
cp target/generated-docs/index.html snapshot/htmlsingle
14-
mkdir -p snapshot/pdf
15-
cp target/generated-docs/index.pdf snapshot/pdf
16-
mkdir -p snapshot/api
17-
cp -r target/site/apidocs/* snapshot/api/
18-
git add snapshot/
17+
mkdir -p $RELEASE_VERSION/htmlsingle
18+
cp target/generated-docs/index.html $RELEASE_VERSION/htmlsingle
19+
mkdir -p $RELEASE_VERSION/pdf
20+
cp target/generated-docs/index.pdf $RELEASE_VERSION/pdf
21+
mkdir -p $RELEASE_VERSION/api
22+
cp -r target/site/apidocs/* $RELEASE_VERSION/api/
23+
git add $RELEASE_VERSION/
24+
25+
if [[ $LATEST == "true" ]]
26+
then
27+
if [[ $RELEASE_VERSION == *[RCM]* ]]
28+
then
29+
DOC_DIR="milestone"
30+
elif [[ $RELEASE_VERSION == *SNAPSHOT* ]]
31+
then
32+
DOC_DIR="snapshot"
33+
else
34+
DOC_DIR="stable"
35+
fi
36+
37+
mkdir -p $DOC_DIR/htmlsingle
38+
cp target/generated-docs/index.html $DOC_DIR/htmlsingle
39+
mkdir -p $DOC_DIR/pdf
40+
cp target/generated-docs/index.pdf $DOC_DIR/pdf
41+
mkdir -p $DOC_DIR/api
42+
cp -r target/site/apidocs/* $DOC_DIR/api/
43+
git add $DOC_DIR/
44+
45+
fi
46+
1947
git commit -m "$MESSAGE"
2048
git push origin gh-pages
21-
git checkout main
49+
git checkout main

release-versions.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
RELEASE_VERSION="0.1.0.RC1"
2+
DEVELOPMENT_VERSION="0.1.0-SNAPSHOT"
3+
RELEASE_BRANCH="main"
4+
LATEST=true
5+

0 commit comments

Comments
 (0)