-
Notifications
You must be signed in to change notification settings - Fork 13
/
push.sh
42 lines (29 loc) · 1 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
cd $TRAVIS_BUILD_DIR
SHA=`git rev-parse --verify HEAD`
git config user.name "Travis CI"
git config user.email "kicad.klc.bot@gmail.com"
git add _symbols
git add _footprints
git add _packages3d
git add download
git add _data
git add _includes
# Debug info
git status
# If there are no changes to the compiled out (e.g. this is a README update) then just bail.
if git diff origin/master --quiet; then
echo "No changes found; exiting."
exit 0
fi
echo "Pushing changes to origin master"
git commit -m "Autobuild by Travis: ${SHA}"
chmod 600 travis_key
eval `ssh-agent -s`
ssh-add travis_key
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
git remote set-url --push origin git@github.com:KiCad/kicad.github.io.git
# create a tag (date-travis) for the master branch
TAG="$(date -u -I)"
git tag --annotate --force --message="${TAG} generated by travis" "${TAG}" master
# And push back upstream (must use SSH repo URL)
git push origin master --force --tags -v --progress