-
-
Save bhubbard/e1d2d705d2ab59d9af166df51c387b0d to your computer and use it in GitHub Desktop.
Codeship Deploy to WPEngine
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
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