Skip to content

Instantly share code, notes, and snippets.

@kalenjohnson
Last active June 1, 2016 20:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kalenjohnson/0e5805894a75bcec0204 to your computer and use it in GitHub Desktop.
Save kalenjohnson/0e5805894a75bcec0204 to your computer and use it in GitHub Desktop.
Codeship Deploy to WPEngine
REMOTE_REPOSITORY=${REMOTE_REPOSITORY:?'You need to configure the REMOTE_REPOSITORY environment variable!'}
REMOTE_BRANCH=${REMOTE_BRANCH:?'You need to configure the REMOTE_BRANCH environment variable!'}
set -e
git fetch --unshallow || true
git push ${REMOTE_REPOSITORY} ${CI_COMMIT_ID}:${REMOTE_BRANCH}
cd wp-content/themes/<theme>
npm install -g bower gulp
npm install
bower install
gulp --production
mv dist dist-new
sshpass -p ${SFTP_PASS} sftp -P2222 <user>@<0.0.0.0>:wp-content/themes/<theme> <<< $'mkdir dist-new\n put -r dist-new\n rename dist dist-old\n rename dist-new dist\n rm dist-old/fonts/*\n rmdir dist-old/fonts\n rm dist-old/scripts/*\n rmdir dist-old/scripts\n rm dist-old/styles/*\n rmdir dist-old/styles\n rm dist-old/images/*\n rmdir dist-old/images\n rm dist-old/*\n rmdir dist-old'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment