-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush.sh
executable file
·50 lines (37 loc) · 1.54 KB
/
push.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
44
45
46
47
48
49
#!/bin/sh
set -e
# ---------------------------------------------------------------------------------
echo "Checking if HEAD hasn't changed on remote..."
echo ""
HEAD_LOCAL=`git rev-parse HEAD`
HEAD_REMOTE=`git ls-remote --heads origin master | cut -c1-40`
echo "Head (local): $HEAD_LOCAL"
echo "Head (remote): $HEAD_REMOTE"
echo ""
if [ "$HEAD_LOCAL" != "$HEAD_REMOTE" ]; then
echo "HEAD CHANGED, ABORTING BUILD!"
echo ""
exit 1
fi
# ---------------------------------------------------------------------------------
echo "Pushing to ccxt.wiki"
cd build/ccxt.wiki
cp -R ../../wiki/* .
git commit -a -m ${COMMIT_MESSAGE} || true
git remote remove origin
git remote add origin https://${GITHUB_TOKEN}@github.com/ccxt/ccxt.wiki.git
git push origin HEAD:master
cd ../..
# ---------------------------------------------------------------------------------
echo "Pushing generated files back to GitHub..."
LAST_COMMIT_MESSAGE="$(git log --no-merges -1 --pretty=%B)"
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
git add php/*.php php/async/*.php php/test/*.php python/ccxt/test/*.py python/ccxt/async_support/*.py python/ccxt/*.py wiki/*
git add -f python/LICENSE.txt python/package.json python/README.md
git commit -a -m "${COMMIT_MESSAGE}" -m '[ci skip]'
git tag -a "${COMMIT_MESSAGE}" -m "${LAST_COMMIT_MESSAGE}" -m "" -m "[ci skip]"
git remote remove origin
git remote add origin https://${GITHUB_TOKEN}@github.com/ccxt/ccxt.git
node build/cleanup-old-tags --limit
git push origin --tags HEAD:master