-
-
Save tnchuntic/155fa6d5a794251ccaff762c04fa383c to your computer and use it in GitHub Desktop.
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
# Get around shallow update restriction | |
if [ -f ${HOME}/clone/.git/shallow ]; then git fetch --unshallow; fi | |
# Add User Data | |
git config --global user.name "wpengine-git-push-user-name" | |
git config --global user.email "my-wpengine-account-email-address" | |
# Add servers | |
git remote add servers $WPENGINE_GIT_PUSH_REMOTE | |
git remote set-url --add --push servers $WPENGINE_GIT_PUSH_REMOTE | |
git remote set-url --add --push servers $WPENGINE_GIT_PUSH_REMOTE_2 | |
git remote set-url --add --push servers $WPENGINE_GIT_PUSH_REMOTE_3 | |
# Install needed modules | |
npm install -g grunt-cli | |
npm install -g ruby | |
npm install -g sass | |
# Re-create folder structure of root directory of a WordPress server just for this plugin or theme | |
# Move repo files to a named folder | |
mkdir $FOLDERNAME | |
shopt -s extglob | |
mv !($FOLDERNAME) $FOLDERNAME | |
# Exclude development-only files from commit by enforcing our codeshipignore file instead | |
rm .gitignore | |
mv .codeshipignore $FOLDERNAME/.gitignore | |
# Move named folder into a structure identical to the root directory of a WordPress server | |
mkdir -p $DIRECTORY | |
mv $FOLDERNAME $DIRECTORY | |
cd $DIRECTORY/$FOLDERNAME/ | |
# Build - production only | |
npm start | |
# Build - staging only | |
npm install | |
composer install | |
grunt develop | |
npm run checkwp | |
# Release - production only | |
grunt release | |
# Deploy | |
git add --all :/ | |
git commit -m "DEPLOYMENT" | |
git push servers HEAD:refs/heads/master --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment