forked from xapi-project/xen-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·36 lines (27 loc) · 1.13 KB
/
deploy.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
#!/bin/bash
# Make sure we're not echoing any sensitive data
set +x
set -o errexit -o nounset
if [ "$TRAVIS_BRANCH" != "master" ]
then
echo "This commit was made against the $TRAVIS_BRANCH and not the master! No deploy!"
exit 0
fi
# Error out if $GH_TOKEN is empty or unset
: ${GH_TOKEN:?"GH_TOKEN needs to be uploaded via travis-encrypt"}
rev=$(git rev-parse --short HEAD)
# Copy data we're interested in out of the container
docker cp ${CONTAINER_NAME}:/home/builder/xen-api/ocaml/idl/json_backend/xenapi.json $HOME/
docker cp ${CONTAINER_NAME}:/home/builder/xen-api/ocaml/idl/json_backend/release_info.json $HOME/
# Go to home and setup git
cd $HOME
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
# Using token clone xapi-project.github.io.git
git clone --quiet "https://$GH_TOKEN@github.com/xapi-project/xapi-project.github.io.git" &>/dev/null
# Copy data we're interested in into the right place
cd xapi-project.github.io
cp -f $HOME/xenapi.json _data/
cp -f $HOME/release_info.json _data/
git commit -am "Updated XenAPI docs based on xen-api/${rev}"
git push -q origin master &>/dev/null