From d64c26e6f216526c2aa34d8783c0e407fc7389c5 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Tue, 13 Oct 2015 12:34:34 +0300 Subject: [PATCH] travis: commit and push only if GH_TOKEN is set This allows to enable travis build for a pull request without failing it. This is useful to check at leat that Makefile syntax is correct. --- .travis.yml | 10 +--------- tools/travis-push.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) create mode 100755 tools/travis-push.sh diff --git a/.travis.yml b/.travis.yml index 50f05cd4..d6024c31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,15 +3,7 @@ sudo: false script: - make versions.json - - git config --global user.email 'mxebot@gmail.com' - - git config --global user.name 'MXEBot as Travis CI' - - git config --global push.default simple - - git config credential.helper "store --file=.git/credentials" - - echo "https://${GH_TOKEN}:@github.com" > .git/credentials - - git remote set-url origin 'https://github.com/mxe/mxe.git' - - git commit -a -m 'Update versions.json' || true - - git push origin HEAD:master - - git push origin HEAD:gh-pages + - if [ "$GH_TOKEN" != "" ]; then ./tools/travis-push.sh; fi env: global: diff --git a/tools/travis-push.sh b/tools/travis-push.sh new file mode 100755 index 00000000..8aa02c06 --- /dev/null +++ b/tools/travis-push.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -ue + +git config --global user.email 'mxebot@gmail.com' +git config --global user.name 'MXEBot as Travis CI' +git config --global push.default simple +git config credential.helper "store --file=.git/credentials" +echo "https://${GH_TOKEN}:@github.com" > .git/credentials +git remote set-url origin 'https://github.com/mxe/mxe.git' +git commit -a -m 'Update versions.json' || true +git push origin HEAD:master +git push origin HEAD:gh-pages