forked from dropwizard/dropwizard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_docs.sh
executable file
·60 lines (46 loc) · 1.6 KB
/
prepare_docs.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
#!/usr/bin/env bash
#
# Builds the documentation of the Dropwizard project for the specified
# release, copies and commits it to the local gh-pages branch.
#
# Usage: ./prepare_docs.sh v1.0.1
#
set -e
[[ "$#" -eq 0 ]] && { echo "No release branch is specified"; exit 1; }
release_branch="$1"
release_number="${release_branch:1}"
echo -e "\nGenerating Dropwizard documentation"
echo "Release branch: $release_branch"
echo "Release number: $release_number"
echo -e "\n-------------------------------"
echo "Moving to $release_branch branch"
echo "-------------------------------"
git checkout "$release_branch"
echo -e "\n-------------------------------"
echo "Generating documentation"
echo -e "-------------------------------\n"
mvn clean site
echo -e "\n-------------------------------"
echo "Staging documentation"
echo "-------------------------------"
mvn site:stage
echo -e "\n-------------------------------"
echo "Moving to the gh-pages branch"
echo -e "-------------------------------\n"
git checkout gh-pages
echo -e "\n-------------------------------"
echo "Creating a directory for documentation"
echo -e "-------------------------------\n"
mkdir "$release_number"
echo -e "\n-------------------------------"
echo "Copy documentation"
echo -e "-------------------------------\n"
cp -r target/staging/* "${release_number}"/
echo -e "\n-------------------------------"
echo "Add and commit changes to the repository"
echo -e "-------------------------------\n"
git add .
git commit -m "Add docs for Dropwizard $release_number"
echo -e "\nDone!"
echo "Please review changes and push them with if they look good"
exit $?