forked from sonatype/nexus-book
-
Notifications
You must be signed in to change notification settings - Fork 2
/
assemble.sh
executable file
·79 lines (65 loc) · 2.67 KB
/
assemble.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# assemble.sh processes the output files created by build.sh and prepares
# the folders target/site and target/archive for rsync runs to
# staging and production
# see build.sh
# see deploy-to-prodcution.sh
# see deploy-to-staging.sh
# see deploy-locally.sh
# fail if anything errors
set -e
# fail if a function call is missing an argument
set -u
dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
echo "Processing in ${dir}"
templateScript=../nexus-documentation-wrapper/apply-template.sh
docProperties=$dir/book.properties
source $docProperties
echo "Nexus Repository Manager Version $version"
if [ $publish_master == "true" ]; then
echo "Preparing for master deployment"
rm -rf target/site/reference
rm -rf target/site/pdf
rm -rf target/site/other
mkdir -p target/site/reference
mkdir -p target/site/pdf
mkdir -p target/site/other
fi
echo "Preparing for version $version deployment"
rm -rf target/site/$version/reference
rm -rf target/site/$version/pdf
rm -rf target/site/$version/other
mkdir -p target/site/$version/reference
mkdir -p target/site/$version/pdf
mkdir -p target/site/$version/other
if [ $publish_master == "true" ]; then
echo "Copying for master deployment"
cp -r target/book-nexus.chunked/* target/site/reference
cp target/book-nexus.pdf target/site/pdf/nxbook-pdf.pdf
cp target/sonatype-nexus-eval-guide.pdf target/site/pdf/sonatype-nexus-eval-guide.pdf
cp target/book-nexus.epub target/site/other/nexus-book.epub
fi
echo "Copying for version $version deployment"
# NOT copying the overall index into version specific directories since links would be broken and
# it is an overall index
cp -r target/book-nexus.chunked/* target/site/$version/reference
cp target/book-nexus.pdf target/site/$version/pdf/nxbook-pdf.pdf
cp target/sonatype-nexus-eval-guide.pdf target/site/$version/pdf/sonatype-nexus-eval-guide.pdf
cp target/book-nexus.epub target/site/$version/other/nexus-book.epub
echo "Copying redirector"
cp -v site/global/index.html target/site/$version/
if [ $publish_master == "true" ]; then
echo "Invoking templating process for master"
$templateScript $dir/target/site/reference $docProperties "block" "../../" "book"
fi
echo "Invoking templating process for $version "
$templateScript $dir/target/site/$version/reference $docProperties "block" "../../../" "book"
if [ $publish_index == "true" ]; then
echo "Preparing root index for deployment"
echo " Copying content and resources"
cp target/index.html target/site
echo "Invoking templating for index page"
$templateScript $dir/target/site/ $docProperties "none" "../" "article"
cp -rv site/global/sitemap*.xml target/site
echo "... done"
fi