Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Deploy scripts for Sage + WPEngine through Codeship Raw
# Setup
# Get around restriction on shallow pushes by WP Engine
git filter-branch -- --all
git checkout staging [OR ANY OTHER BRANCH]
# Add User Data
git config --global "codeship-username"
git config --global ""
# Combine remote git servers
git remote add servers $REPO_STAGING
git remote set-url --add --push servers $REPO_STAGING
# Install needed modules
nvm use stable
npm install -g yarn
# Move repo files to a named folder
shopt -s extglob
# Exclude development-only files from commit
rm .gitignore
mv .codeshipignore $FOLDERNAME/.gitignore
# Move named folder into a structure identical to the root directory of a WordPress server
mkdir -p $DIRECTORY
# Build
yarn run build:production
# Deploy
git add --all :/
git commit -m "DEPLOYMENT"
git push servers HEAD:master --force
# If this is the first time you're running the deployment, you might try this next line instead in case you get a missing branch error:
# git push servers HEAD:refs/heads/master --force

Add these to your Codeship pipeline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment