The Dev Hub is our production org. Scratch orgs are registered against a Dev Hub and can be managed from there. Execute the following command in a terminal (you'll be prompted to enter your username and password in a browser window):
sfdx force:auth:web:login --setdefaultdevhubusername -a Unum_DevHub
It's possible to have multiple Dev Hub orgs. If you want to change to a different Dev Hub, you must specify your defaultdevhubusername
setting with this command:
sfdx force:config:set [email protected] --global
sfdx force:org:create -s -f config/project-scratch-def.json -a Portal_C1_Common_Scratch -d 15
Note: Portal_C1_Common_Scratch
is this example's scratch org name; -d 15
is the duration, how many days until the scratch org expires.
sfdx force:org:list
sfdx force:lightning:test:install
sfdx force:mdapi:deploy -d deploy_pre_steps -u Portal_C1_Common_Scratch
sfdx force:mdapi:deploy -d deploy_pre_steps_portal_common -u Portal_C1_Common_Scratch
sfdx force:source:push -u Portal_C1_Common_Scratch
sfdx force:org:open -u Portal_C1_Common_Scratch
- In Setup > Communities, enable communities and then set prefix to "Portal-C1-Test-JW0001", where "JW" are your initials
- Click "New Community" > Pick "Build Your Own" > Get Started, use "test" for both the Name and URL
- Once Community is created, in Administration > Emails: turn off "Send welcome email"; in Settings: Activate Community
- Go to Communities, select Builder > Publish. Test community. Make sure you can browse to community.
sfdx force:mdapi:deploy -d deploy_post_steps -u Portal_C1_Common_Scratch
sfdx force:mdapi:deploy -d deploy_permission_set -u Portal_C1_Common_Scratch
sfdx force:user:permset:assign --permsetname DX_Developer -u Portal_C1_Common_Scratch
sfdx force:data:tree:import --sobjecttreefiles ./data_files/PortalData.json -u Portal_C1_Common_Scratch
sfdx force:data:bulk:upsert -s ForgeRock_Settings__c -f ./data_files/ForgeRock_Settings__c.csv -i Id
- Load the site content for core and client communities (files in ./communities_content/):
-
Setup > all communities > Workspaces > Administration > Pages > Go to Site.com Studio: click the gear icon in the top right corner:
- Select "Overwrite This Site": Browse to the appropriate .site file, click Overwrite, then Publish Changes
-
Do this for both communities. Make sure you can browse to community.
Scrum teams should create a new branch for any development work.
- Create a new branch from master - use Eclipse or other IDE to create a branch
- Branch naming convention:
TeamNameReleaseDate - ReleaseDate
inYYYYMMDD
format
If you need to add a field, create a Lightning component, change Apex classes, etc., you can make changes in the scratch org using the Salesforce interface and Developer Console. You can also create components, classes, etc., using the IDE or command line.
If you make changes in the scratch org, you will need to "pull" the code from the org:
sfdx force:source:pull
If you make changes using an IDE, you will have to "push" those changes to the scratch org:
sfdx force:source:push
sfdx force:org:delete -u Portal_C1_Common_Scratch
Follow the standard git commit process:
git status
git add .
git commit -m ""
git push
sfdx force:lightning:component:create -n Unum_Portal_Common_V1_AS213_Component
sfdx force:apex:class:create -n MyClass
-
Connect to the Dev Hub:
sfdx force:auth:web:login -r https://test.salesforce.com -a Dev
-
Create a folder in root of CS_Unum.Portal.Common:
mkdir mdapi_deploy_dev
- Copy source into folder:
sfdx force:source:convert -d mdapi_deploy_dev/
- Delete items from folders not deploying; update package.xml with items only being deployed
- Deploy to the Dev environment:
sfdx force:mdapi:deploy -d mdapi_deploy_dev/ -u [YOUR_SF_DEV_USERNAME]
- Copy source into folder:
-
Log into the Salesforce Dev environment, check Deployment Status.