mirror of
https://github.com/captn3m0/google-sre-ebook.git
synced 2024-09-28 13:23:05 +00:00
29 lines
577 B
Bash
Executable File
29 lines
577 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Cleanup
|
|
rm -rf html
|
|
mkdir -p html
|
|
cd html
|
|
|
|
# Download
|
|
wget --convert-links --mirror https://landing.google.com/sre/book/
|
|
mv landing.google.com/sre/book/* .
|
|
rm -rf landing.google.com
|
|
cd ..
|
|
|
|
if [ $1 != "docker" ];then
|
|
bundle install
|
|
fi
|
|
|
|
ruby generate.rb
|
|
|
|
pushd html/chapters
|
|
pandoc -f html -t epub -o ../../google-sre.epub --epub-metadata=../../metadata.xml --epub-cover-image=../../cover.jpg sre.html
|
|
popd
|
|
ebook-convert google-sre.epub google-sre.mobi
|
|
|
|
if [ "$1"=="docker" ]; then
|
|
chown -v $(id -u):$(id -g) google-sre.*
|
|
mv -f google-sre.* /output
|
|
fi
|