-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdeploy_docs.sh
More file actions
31 lines (22 loc) · 839 Bytes
/
deploy_docs.sh
File metadata and controls
31 lines (22 loc) · 839 Bytes
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
#!/bin/bash
# Exit the script if something messes up, so we don't accidentally the whole thing
set -e
DEPLOY_DIR=$1
echo "Deploying docs to ${DEPLOY_DIR}"
git config --global user.email "[email protected]"
git config --global user.name "travis-ci"
echo "Pulling from gh-pages"
mkdir $HOME/gh-pages
cd $HOME/gh-pages
git init
git pull "https://github.com/teamhyper/hyperLib.git" gh-pages
echo "Copying docs over..."
mkdir -p doc/${DEPLOY_DIR}
cp -Rf ${TRAVIS_BUILD_DIR}/build/docs/javadoc/* doc/${DEPLOY_DIR}
echo "Generating new index..."
m4 -P index.m4 > index.html
echo "Committing and pushing..."
git add -f .
git commit -m "Add latest javadoc from build $TRAVIS_BUILD_NUMBER to $DEPLOY_DIR"
git push -f "https://${GH_TOKEN}@github.com/teamhyper/hyperLib.git" +master:gh-pages &> /dev/null
echo "Docs successfully deployed"