google-sre-ebook/bootstrap.sh

32 lines
732 B
Bash
Raw Normal View History

2017-09-16 16:22:31 +00:00
#!/bin/bash
2018-05-16 20:24:54 +00:00
# Cleanup
2017-09-16 17:45:59 +00:00
rm -rf html
mkdir -p html/index
mkdir -p html/sre-book
2017-09-16 16:22:31 +00:00
cd html
2018-05-16 20:24:54 +00:00
# Download
wget --convert-links --mirror https://landing.google.com/sre/book/
mv landing.google.com/sre/sre-book/* ./sre-book
mv landing.google.com/sre/book/index.html ./index
2017-09-16 16:22:31 +00:00
rm -rf landing.google.com
cd ..
2018-05-16 20:24:54 +00:00
if [ $1 != "docker" ];then
bundle install
fi
2017-09-16 16:22:31 +00:00
ruby generate.rb
2017-09-16 17:45:59 +00:00
pushd html/sre-book/chapters
pandoc -f html -t epub -o ../../../google-sre.epub --epub-metadata=../../../metadata.xml --epub-cover-image=../../../cover.jpg sre.html
popd
2017-09-16 17:45:59 +00:00
ebook-convert google-sre.epub google-sre.mobi
2018-08-03 15:00:12 +00:00
ebook-convert google-sre.epub google-sre.pdf
2018-05-16 20:24:54 +00:00
if [ "$1"=="docker" ]; then
chown -v $(id -u):$(id -g) google-sre.*
mv -f google-sre.* /output
fi