-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdeploy_docs.sh
executable file
·43 lines (38 loc) · 1.37 KB
/
deploy_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
#!/bin/bash
#
# This script is used by travis to deploy generated docs
#
function doCompile {
~/catkin_ws/src/auv2016/utils/generate_docs.sh
}
# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]; then
echo "Skipping deploy; just doing a build."
doCompile
exit 0
fi
# Clone the existing gh-pages for this repo into html/
# Create a new empty branch if gh-pages doesn't exist yet (should only happen on first deply)
git clone "https://github.com/AUV-IITK/auv2016.git" ~/catkin_ws/src/auv2016/html/
cd ~/catkin_ws/src/auv2016/html/
# Save some useful information
export SHA=`git rev-parse --verify HEAD`
git checkout -b gh-pages origin/gh-pages
cd ..
# Clean html/ existing contents except .git folder
rm -rf ~/catkin_ws/src/auv2016/html/*
# Run our compile script
echo "compile docs"
doCompile
# Now let's go have some fun with the cloned repo
cd ~/catkin_ws/src/auv2016/html/
echo "git config"
git config user.name "Shikher Verma"
git config user.email "[email protected]"
# Commit the "changes", i.e. the new version.
# The delta will show diffs between new and old versions.
git add . --all
echo "git commit"
git commit -m "Deploy $SHA"
# Now that we're all set up, we can push.
git push -f -q https://ShikherVerma:[email protected]/AUV-IITK/auv2016.git gh-pages