Skip to content

Instantly share code, notes, and snippets.

@saicharanreddyk
Last active June 8, 2022 23:48
Show Gist options
  • Save saicharanreddyk/8b2e405df276ae36b5d5a825c6b44d60 to your computer and use it in GitHub Desktop.
Save saicharanreddyk/8b2e405df276ae36b5d5a825c6b44d60 to your computer and use it in GitHub Desktop.
Automation
printf "Setting the session-based environment variables\n"
export devhubname= Enter you Devhub org username
export consumerkey= Enter consumer Key
export jwtkeylocation="Location of the server.key"
export location="Where do you want your projects needs to be"
printf "Changing the location into project folder\n"
cd "$location"
printf "Creating new directory $(date +'%Y%m%d%H%M')\n"
mkdir $(date +'%Y%m%d%H%M')
cd $(date +'%Y%m%d%H%M')
printf "Cloning dreamhouse github repo\n"
git clone https://github.com/dreamhouseapp/dreamhouse-sfdx.git
cd dreamhouse-sfdx
printf "Authorizing Dev Hub Org using JWT flow\n"
sfdx force:auth:jwt:grant --clientid $consumerkey --jwtkeyfile "$jwtkeylocation" --username $devhubname --setdefaultdevhubusername --setalias CLISessionDevHub
printf "Creating scratch org using the just now authorized devhub org\n"
sfdx force:org:create --setdefaultusername --definitionfile config/project-scratch-def.json --setalias $(date +'%Y%m%d%H%M') --wait 10 --durationdays 30
printf "Pushing the dreamhouse metadata to scratch orgcreated just now"
sfdx force:source:push
printf "Assigning permission set inorder to see the dreamhouse application"
sfdx force:user:permset:assign -n dreamhouse
printf "Loading the data into Brokers and Properties"
sfdx force:data:tree:import -p data/sample-data-plan.json
printf "Opening scratch org"
sfdx force:org:open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment