-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_quattor_docs.sh
executable file
·65 lines (48 loc) · 1.77 KB
/
build_quattor_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
61
62
63
64
65
#!/bin/bash
VERSION="master"
# Create temporary working directory
mkdir -p /tmp/quattor-documentation/{src,output}
cd /tmp/quattor-documentation/src
# Clone required github repositories
for REPO in CAF configuration-modules-core configuration-modules-grid CCM ; do
git clone https://github.com/quattor/$REPO.git
cd $REPO
tag=`git tag -l | grep "$VERSION$"`
git checkout -q $tag
cd ..
done
cd ..
# Install required software
#sudo yum install python-pip python-devel perl-Pod-Markdown
#pip install --user --upgrade livereload vsc-utils mkdocs
# Get documentation build script
curl -k https://raw.githubusercontent.com/quattor/release/master/src/releasing/quattorpoddoc.py -o quattorpoddoc.py
# Start building the documentation
python quattorpoddoc.py -c -m src/ -o output/ --info
# Get required index which is not generated
curl https://raw.githubusercontent.com/quattor/documentation/master/docs/index.md -o output/docs/index.md
# Build site for testing
cd output
mkdocs build --clean
# Get the tests set up
#sudo yum install rubygem-bundler ruby-devel zlib-devel
curl https://raw.githubusercontent.com/quattor/documentation/master/Gemfile -o Gemfile
bundle install
# Run the tests
bundle exec htmlproofer --check-html ./site/ --file-ignore ./site/base.html,./site/breadcrumbs.html,./site/footer.html,./site/toc.html,./site/versions.html || { echo 'build test errors detected. stopping.' ; exit 1 ; }
cd ..
# Cleanup
rm output/Gemfile.lock
rm -r output/site
# Setup target (GH)
git clone [email protected]:wdpypere/docs-test-comps.git
cd docs-test-comps
git branch docs-$VERSION
git checkout docs-$VERSION
# Out with the old (make sure deprecated/deleted pages no longer show up)
rm -r docs
rm mkdocs.yml
# In with the new
mv ../output/mkdocs.yml .
mv ../output/docs .
git status