这篇文章给大家介绍Salesforce中DX学习的示例分析,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。
登录到开发中心 sfdx force:auth:web:login -d -a DevHub
-a 创建别名 -d 设置为默认组织
创建文件夹 mkdir folderName
cd folderName
clone
git clone https://github.com/dreamhouseapp/dreamhouse-sfdx.git
删除scratch
sfdx force:org:delete
一个scratch 配置
{ "orgName": "Dreamhouse", "edition": "Developer", "hasSampleData": "false", "settings": { "orgPreferenceSettings": { "s1DesktopEnabled": true, "selfSetPasswordInApi": true, "s1EncryptedStoragePref2": false } } }
创建Scratch Org 并设置为默认 sfdx force:org:create -s -f config/project-scratch-def.json -a dreamhouse-org
打开指定org sfdx force:org:open -u xxx
将元数据推送到Scratch sfdx force:source:push
分配权限 sfdx force:user:permset:assign -n xxxx
导入样本数据 sfdx force:data:tree:import --plan data/sample-data-plan.json
需要在sfdx中设置DevHub为默认,同时需要开启package
sfdx force:package:create --name dreamhouse --description "My Package" --packagetype Unlocked --path force-app --nonamespace --targetdevhubusername DevHub
--name is the package name. This name is an alias you can use when running subsequent packaging commands.
--path is the directory that contains the contents of the package.
--packagetype indicates which kind of package you’re creating, in this case, unlocked.
创建版本: sfdx force:package:version:create -p dreamhouse -d force-app -k test1234 --wait 10 -v DevHub
-p is the package alias that maps to the package ID.
-d is the directory that contains the contents of the package.
-k is the installation key that protects your package from being installed by unauthorized individuals.
转换成正式版本:
sfdx force:package:version:promote -p dreamhouse@1.0.0-1 -v DevHub
安装到Org中:
sfdx force:package:install --wait 10 --publishwait 10 --package dreamhouse@1.0.0-1 -k test1234 -r -u MyScratchOrg
关于Salesforce中DX学习的示例分析就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。