Add these to your Codeship pipeline
Created
May 4, 2017 23:06
-
-
Save jamesfacts/23333a7ee5cb048196304c416f78e1ca to your computer and use it in GitHub Desktop.
Deploy scripts for Sage + WPEngine through Codeship Raw
This file contains 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
# 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 user.name "codeship-username" | |
git config --global user.email "[email protected]" | |
# 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 | |
mkdir $FOLDERNAME | |
shopt -s extglob | |
mv !($FOLDERNAME) $FOLDERNAME | |
# 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 | |
mv $FOLDERNAME $DIRECTORY | |
cd $DIRECTORY/$FOLDERNAME/ |
This file contains 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
# Build | |
yarn | |
yarn run build:production |
This file contains 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
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment