Skip to content

Instantly share code, notes, and snippets.

@ryanshoover
Last active March 1, 2018 17:40
Show Gist options
  • Select an option

  • Save ryanshoover/5b250c9ecfc1dcfc4aab8165d9fb14f7 to your computer and use it in GitHub Desktop.

Select an option

Save ryanshoover/5b250c9ecfc1dcfc4aab8165d9fb14f7 to your computer and use it in GitHub Desktop.
~DEPRECATED~ CircleCI 1.0 YAML script for continuous integration with a WP Engine install. CircleCI 1.0 is deprectaed. Check out a CircleCI 2.0 configuration at https://gist.github.com/ryanshoover/ce4bb081b95168840b8c51b2a033c500
machine:
environment:
WPE_INSTALL: myinstallname
php:
version: 7.0.17
## Wordpress Code standard
dependencies:
pre:
# Grunt v 1.0.1 only passes installation if it's installed globally
- npm install -g grunt
## Grunt Test
test:
override:
- echo $CIRCLE_BRANCH
- if [[ $CIRCLE_BRANCH != 'master' && $CIRCLE_BRANCH != 'staging' ]]; then (grunt test); fi;
## Deployement
deployment:
###Staging
staging:
branch: staging
commands:
- git ls-remote [email protected]:staging/${WPE_INSTALL}.git
- git config --global user.email "[email protected]"
- git config --global user.name "Thisis Myname"
- git remote add wpe [email protected]:staging/${WPE_INSTALL}.git
- git fetch wpe --unshallow
- git status
- git checkout -b staging-$CIRCLE_BUILD_NUM
- unlink .gitignore
- ln -s .gitignores/__deployment .gitignore
- grunt build
- git add .
- git commit -m "deployment commit"
- git push wpe staging-$CIRCLE_BUILD_NUM
- git push wpe :staging-$CIRCLE_BUILD_NUM
###Production
production:
branch: master
commands:
- git ls-remote [email protected]:production/${WPE_INSTALL}.git
- git config --global user.email "[email protected]"
- git config --global user.name "Thisis Myname"
- git remote add wpe [email protected]:production/${WPE_INSTALL}.git
- git fetch wpe --unshallow
- git status
- git checkout -b master-$CIRCLE_BUILD_NUM
- unlink .gitignore
- ln -s .gitignores/__deployment .gitignore
- grunt build
- git add .
- git commit -m "deployment commit"
- git push wpe master-$CIRCLE_BUILD_NUM
- git push wpe :master-$CIRCLE_BUILD_NUM
## Experimental (beta) settings
experimental:
notify:
branches:
only:
- master
- staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment