]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/python/.ci/upload_docs.sh
2 set -e # Exit with nonzero exit code if anything fails
5 TARGET_BRANCH
="gh-pages"
7 # Pull requests and commits to other branches shouldn't try to deploy, just build to verify
8 if [ "$TRAVIS_PULL_REQUEST" != "false" ] || \
9 [ "$TRAVIS_BRANCH" != master
-a \
10 "$TRAVIS_BRANCH" != develop
-a \
11 "$TRAVIS_BRANCH" != travis
]; then
12 echo "No docs to upload."
16 if [ -z "$GH_TOKEN" ]; then
17 echo "Error: GH_TOKEN is undefined"
21 # Save some useful information
22 REPO
=`git config remote.origin.url`
23 SHA
=`git rev-parse --verify HEAD`
25 # bin.SCons happens to contain the "doc/html" tree that we want to push
26 # into the gh-pages branch. So we step into that directory, create a new repo,
27 # set the remote appropriately, then commit and push.
30 git config user.name
"Travis CI"
31 git config user.email
"travis-ci"
33 # Make sure 'GH_TOKEN' is set (as 'secure' variable) in .travis.yml
34 git remote add upstream
"https://$GH_TOKEN@github.com/boostorg/python.git"
36 git
reset upstream
/gh-pages
39 if [ "$TRAVIS_BRANCH" = develop
-o "$TRAVIS_BRANCH" = travis
]; then
41 cp ..
/index.html develop
/
42 cp ..
/doc
/index.html develop
/doc
/
43 cp -a doc
/html develop
/doc
/
44 git add develop
/index.html
45 git add develop
/doc
/index.html
46 git add
-A develop
/doc
/html
49 cp ..
/doc
/index.html
doc
/
51 git add
doc
/index.html
54 # Commit the new version.
55 git commit
-m "Deploy to GitHub Pages: ${SHA}"
57 # Now that we're all set up, we can push.
58 git push
-q upstream HEAD
:gh-pages