forked from theopensourceway/guidebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-book.sh
executable file
·28 lines (28 loc) · 1.07 KB
/
publish-book.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
#/bin/bash
#
# this script presumes you have the two git repos checked out
# into the same parent directory:
#
# git clone [email protected]:theopensourceway/guidebook.git
# git clone [email protected]:theopensourceway/theopensourceway_old_website.git
# cd guidebook/
# ./publish-book.sh
#
# call the script that generates the PDF and HTML artifacts
echo "running book build script ..."
./build-book.sh
# copy the artifacts into the website directory in a relative location
echo "copying HTML and PDF output to website repo ..."
cp the_open_source_way-guidebook-2.0.{pdf,html} ../theopensourceway_old_website/website/
# switch over the the website directory for the rest of the script
echo "committing and pushing new build to the website ..."
cd ../theopensourceway_old_website/website/
# check the artificats into the git repo
echo "git add ..."
git add the_open_source_way-guidebook-2.0.*
echo "git commit ..."
git commit -m "updating published content to latest build from source"
# push the changes to git repo, where they are automatically deployed
echo "git push ..."
git push
echo "done!"