Last active
February 11, 2018 15:56
-
-
Save justinwhall/e13d44e8bd192d9077b6ece832f7e61e to your computer and use it in GitHub Desktop.
Pantheon TravisCI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Encrypted travis ENV vars | |
# $PANTHEON_UUID === Pantheon UUID | |
# $GIT_EMAIL === Email associated to panthoeon user (and SSH key) | |
sudo: false | |
env: | |
global: | |
- PANTHEON_SITE='pantheon-site-name' | |
- WP_MULTISITE=0 | |
notifications: | |
email: | |
on_success: never | |
on_failure: change | |
cache: | |
directories: | |
- node_modules | |
- vendor | |
- $HOME/phpunit-bin | |
language: | |
- php | |
php: | |
- 7.0 | |
before_install: | |
- WP_VERSION=latest WP_MULTISITE=0 | |
install: | |
- nvm install 6 && nvm use 6 | |
- export DEV_LIB_PATH=dev-lib | |
- if [ ! -e "$DEV_LIB_PATH" ] && [ -L .travis.yml ]; then export DEV_LIB_PATH=$( dirname $( readlink .travis.yml ) ); fi | |
- if [ ! -e "$DEV_LIB_PATH" ]; then git clone https://github.com/xwp/wp-dev-lib.git $DEV_LIB_PATH; fi | |
- source $DEV_LIB_PATH/travis.install.sh | |
- ssh-keyscan -p 2222 codeserver.dev.$PANTHEON_UUID.drush.in >> ~/.ssh/known_hosts | |
- git config --global user.email $GIT_EMAIL | |
before_script: | |
- git remote add pantheon ssh://[email protected].$PANTHEON_UUID.drush.in:2222/~/repository.git | |
script: | |
- source $DEV_LIB_PATH/travis.script.sh | |
after_script: | |
- source $DEV_LIB_PATH/travis.after_script.sh | |
after_success: | |
- if [ $TRAVIS_BRANCH == 'master' ] && [ $TRAVIS_PULL_REQUEST == 'false' ]; then git fetch pantheon && git merge -m "Merge changes from pantheon into github" pantheon/master && git push origin HEAD:master && git push pantheon HEAD:master; fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment