Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This is my deployment script for pushing from Github to a WP Engine WordPress install. The scripts below can be added as custom scripts to Codeship's Deployment Pipelines.
# Environment Variables
#INSTALL=
#EMAIL=
#ENVIRONMENT="production"
#SERVICE=
#ASSERTIBLE_CODE=
# Use PHP 7.2 and stable version of node
phpenv local 7.2
nvm use stable
# Set production remote and config
git config --global user.name "Codeship Deploy"
git config --global user.email "$EMAIL"
git remote add $ENVIRONMENT git@git.wpengine.com:$ENVIRONMENT/$INSTALL.git
# Install gulp and bower
npm install -g gulp bower
# Run Composer to install dependencies
cd wp-content/themes/sage
composer install --prefer-source --no-interaction
npm install
bower install
gulp --production
# Swap out gitignore file to allow dist directory to be included in repo
rm .gitignore
mv .codeshipignore .gitignore
# Remove theme files that don't need to be on production
git rm -rf .bowerrc .editorconfig .jscsrc .jshintrc .travis.yml *.md *.json *.lock config gulpfile.js lang assets
# Push branch to WP Engine master
git add --all
git commit -m "Codeship Deployment"
git push $ENVIRONMENT HEAD:master --force
# Assertible Tests
curl -u $ASSERTIBLE_CODE: "https://assertible.com/deployments" -d'{
"service": "$SERVICE",
"environmentName": "production",
"version": "v1"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.