Last active
February 7, 2020 00:03
-
-
Save Julian88Tex/d0b7b61b38573f6055727c659a4bab60 to your computer and use it in GitHub Desktop.
Shell script for rebuilding an NPSP QA org created with CumulusCI with latest branch changes
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
#!/usr/bin/env bash | |
# Script to be used by qa to rebuild a scratch environment. | |
echo | |
echo ***WARNING******WARNING******WARNING******WARNING******WARNING******WARNING******WARNING******WARNING******WARNING******WARNING******WARNING*** | |
echo | |
echo This script is to be used by qa to rebuild a scratch environment. | |
echo This script will rollback any modifications to files and delete a scratch org with the same name given. | |
echo Please save and stage any file changes before running this script or they will be undone. | |
echo | |
echo ***WARNING******WARNING******WARNING******WARNING******WARNING******WARNING******WARNING******WARNING******WARNING******WARNING******WARNING*** | |
echo | |
# Prompt for conifrmation | |
read -p "Are you sure? [Y/n]" -n 1 -r | |
echo # (optional) move to a new line | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
# Request branch name | |
read -p "What branch would you like to pull most recent changes from?? [example: feature/julian-qa-rebuild-script] " -r branch_name | |
# Request org name | |
read -p "What would you like to name your org? [example: W-123456] " org_name | |
# Remove any existing modified files so a pull can take place | |
git checkout -- . | |
# Pull most recent changes | |
git pull | |
# Switch to desired branch | |
git checkout $branch_name | |
# Delete exisiting scratch org if one exists with provided name | |
cci org scratch_delete $org_name | |
# Create Scratch | |
cci org scratch dev $org_name | |
# Rebuild org with qa flow | |
cci flow run qa_org --org $org_name | |
# Mark org as default | |
cci org default $org_name | |
# Open newly created org | |
cci org browser $org_name | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment