Last active
March 26, 2024 11:10
-
-
Save bethbrains/7897ebab7db7efaf34cf279cde8a165d 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
#!/usr/bin/env bash | |
echo 'Installing Package 1: Contacts & Organizations...' | |
sfdx force:package:install -i 04t80000000gYcf -w 100 | |
if [ "$?" = "0" ]; then | |
echo 'Installation of Package 1 complete...' | |
else | |
echo 'Installation failed.' | |
exit 1 | |
fi | |
echo 'Installing Package 2: Households...' | |
sfdx force:package:install -i 04t80000000jYrO -w 100 | |
if [ "$?" = "0" ]; then | |
echo 'Installation of Package 2 complete...' | |
else | |
echo 'Installation failed.' | |
exit 1 | |
fi | |
echo 'Installing Package 3: Recurring Donations...' | |
sfdx force:package:install -i 04t80000000tpCB -w 100 | |
if [ "$?" = "0" ]; then | |
echo 'Installation of Package 3 complete...' | |
else | |
echo 'Installation failed.' | |
exit 1 | |
fi | |
echo 'Installing Package 4: Relationships...' | |
sfdx force:package:install -i 04t80000000tpCG -w 100 | |
if [ "$?" = "0" ]; then | |
echo 'Installation of Package 4 complete...' | |
else | |
echo 'Installation failed.' | |
exit 1 | |
fi | |
echo 'Installing Package 5: Affiliations...' | |
sfdx force:package:install -i 04t80000001AVBM -w 100 | |
if [ "$?" = "0" ]; then | |
echo 'Installation of Package 5 complete...' | |
else | |
echo 'Installation failed.' | |
exit 1 | |
fi | |
echo 'Deploying record types...' | |
curl -O -L https://github.com/SalesforceFoundation/Cumulus/archive/master.zip | |
unzip master.zip | |
sfdx force:mdapi:deploy -d Cumulus-master/unpackaged/pre/account_record_types/ -w 100 | |
if [ "$?" = "0" ]; then | |
echo 'Deployment of Account Record Types complete...' | |
else | |
echo 'Deployment failed.' | |
exit 1 | |
fi | |
sfdx force:mdapi:deploy -d Cumulus-master/unpackaged/pre/opportunity_record_types/ -w 100 | |
if [ "$?" = "0" ]; then | |
echo 'Deployment of Opportunity Record Types complete...' | |
else | |
echo 'Deployment failed.' | |
exit 1 | |
fi | |
rm -rf Cumulus-master | |
rm master.zip | |
echo 'Installing Package 6: Core NPSP...' | |
sfdx force:package:install -i 04t1Y000001I8rn -w 100 | |
if [ "$?" = "0" ]; then | |
echo 'Installation of Package 6 complete...' | |
else | |
echo 'Installation failed.' | |
exit 1 | |
fi | |
# note this is the version ID as of 9/27/2017 | |
# it updates every 2 weeks | |
# depending on what you actually need, you may/may not want to go get the newest ID from | |
# https://github.com/SalesforceFoundation/Cumulus/releases | |
echo "Done installing NPSP! Would you like to open your scratch org now? [Y/N]" | |
read response | |
if [ "$response" == "Y" ]; then | |
sfdx force:org:open | |
exit 1 | |
fi |
This is great. Thank you so much. I want to point out that the -i is deprecated, and --package should be used instead. Where did you get the package ids, bethbrains?
For anyone reading this in the future, I found the answer to my question. Connect to an org that has the latest version of NPSP via sfdx. Then run sfdx force:package:installed:list -u <alias|username>. You can get the Package Version Id from the output in the command line.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Love the script! Couple thoughts though: