-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathchain.sh
35 lines (28 loc) · 1.06 KB
/
chain.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
#!/bin/bash
function error_exit
{
echo -e "\e[01;31m$1\e[00m" 1>&2
exit 1
}
set -e
if [ "$TRAVIS_PULL_REQUEST" == "false" ] && ( [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == "development" ]); then
# trigger OS-X-build
echo -e "Trigger OS X build with content from $TRAVIS_BRANCH\n"
# setup git and clone from gh-pages branch
git checkout "$TRAVIS_BRANCH"
git config --global user.email "[email protected]"
git config --global user.name "Travis Deployer"
# prepare OS X build configuration
rm .travis.yml
mv .travis-os-x.yml .travis.yml
touch "$TRAVIS_BRANCH"
git add -A
git commit -m "Update of OS-X-build branch with latest from $TRAVIS_BRANCH"
# push OS X build configuration commit to OS-X-build brach
git remote set-url origin https://fappel:${GH_TOKEN}@github.com/fappel/xiliary.git
git config --global push.default simple
git push origin HEAD:OS-X-build -fq
# clear user/password info
git remote set-url origin https://xxx:[email protected]/fappel/xiliary.git
echo -e "Done with OS X build trigger\n"
fi