Skip to content

Instantly share code, notes, and snippets.

@msrivastav13
Created July 15, 2021 03:20
Show Gist options
  • Save msrivastav13/6952ac02145f44e40d9754fe9cea3416 to your computer and use it in GitHub Desktop.
Save msrivastav13/6952ac02145f44e40d9754fe9cea3416 to your computer and use it in GitHub Desktop.
EasySpaces Task for Setting up scratch org
{
"version": "2.0.0",
"tasks": [
{
"label": "Create Scratch org",
"type": "shell",
"command": "sfdx",
"args": [
"force:org:create",
"-s",
"-f",
"config/project-scratch-def.json",
"-a",
"easyspaces"
],
"group": "build",
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new",
"showReuseMessage": true,
"clear": false
}
},
{
"label": "Push Source To Scratch org",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:push"
],
"group": "build",
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new",
"showReuseMessage": true,
"clear": false
}
},
{
"label": "Assign Permission Sets",
"type": "shell",
"command": "sfdx",
"args": [
"force:user:permset:assign",
"-n",
"EasySpacesObjects,SpaceManagementApp"
],
"group": "build",
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new",
"showReuseMessage": true,
"clear": false
}
},
{
"label": "Import Lead Data",
"type": "shell",
"command": "sfdx",
"args": [
"force:data:tree:import",
"-p",
"./data/Plan1.json"
],
"group": "build",
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new",
"showReuseMessage": true,
"clear": false
}
},
{
"label": "Import All Data",
"type": "shell",
"command": "sfdx",
"args": [
"force:data:tree:import",
"-p",
"./data/Plan2.json"
],
"group": "build",
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new",
"showReuseMessage": true,
"clear": false
}
},
{
"label": "Initialize Scratch Org",
"type": "shell",
"dependsOn": [
"Create Scratch org",
"Push Source To Scratch org",
"Assign Permission Sets",
"Import Lead Data",
"Import All Data"
],
"group": "build",
"dependsOrder": "sequence",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new",
}
}
]
}
@shanmukprassu
Copy link

Hi, Is there a way how to use the user entered input prompt parameter 1 value directly in the other label area. I'm looking to create a scratch org and add the org as default org.

Step1 : Create scratch org - sfdx force:org:create -f project-config.json -v devhub -u ORG_ALAIS
Step 2: (sfdx force:config:set defaultusername=ORGALIAS) ORGALIAS will be passed by user as a prompt in step 1 while creating the scratch org.

How can I use/refer the ORG_ALIAS passed in step 1 inside step2 within takss.json file. ?

Can you please help by providing an example. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment