Developer-Controlled
Packages (DCPs) を試してみた
takahiro.kawabata@salesforce.com, @tak4hir0
Takahiro Kawabata
⾃⼰紹介
AppExchange アライアンス部
テクニカルエバンジェリスト
川畑 隆博
AppExchange アプリケーションプログラムの技術担当
略歴:Web デベロッパ → Force.com デベロッパ → テクニカルアーキ
テクト → テクニカルエバンジェリスト
今⽇のトピック
概要
QAからイメージ
Q.なぜパッケージングですか?それは私の開発チームにどのよ
うに役⽴つでしょうか?
1. アプリ開発をより簡単に
Make app development easier.
2. デプロイをスクリプト化、追跡可能に
Make deployments repeatable, scriptable and
trackable
3. 組織の変更管理をより
明確に追跡
Track changes to your org more clearly and
easily
4. カスタマイズを管理
Keep your customizations more organized
Why packaging? How can it help my development team?
Announcing Developer Controlled Packaging (DCP) Beta
https://developer.salesforce.com/blogs/2018/02/announcing-
developer-controlled-packaging-dcp-beta.html
Q. パッケージの種類はどれくらいあり、どれを使うべきですか?
あなたがSalesforceの顧客、請負業者、コン
サルタント、またはSystems Integratorであ
る場合、あなたにとって重要な唯⼀のタイプ
のパッケージは、現在利⽤可能なUnlocked
DCPです。
To summarize in one sentence, if you are
a Salesforce customer, contractor,
consultant or Systems Integrator, the only
type of packaging that matters to you is
Unlocked DCPs, which are available to you,
NOW!
What are the different types of packages and which one should I use?
Q.変更セットとANT移⾏ツールに対するDCPのメリットは何で
すか?
1. DCPのパッケージバージョンを作成するときに
指定するメタデータは、Salesforce DXプロジェ
クトおよびバージョン管理システムに含まれるもの
と同じメタデータです。 DCPは、ソース主導の開
発アプローチを推進し、Salesforce DXが使⽤する
メタデータ形式を使⽤します。
2.パッケージバージョンでは、CI、UATなどで使
⽤できる不変のバージョン管理可能な成果物があり
ます。すべてのCIテストとUATを通過する同じ成果
物を本番組織にインストールできます。
3. DCPは、機能を論​​理的、モジュラ的、相互依存
的な単位に編成し、展開と組織化のためにパッケー
ジを使⽤するモジュール開発を促進します。モジュ
ラーで反復的な開発実践に付随するすべての良いも
のを⼿に⼊れることができます。
1. The metadata that you specify when you create a
package version for a DCP is the same metadata
that is contained in your Salesforce DX project and
version control system. DCPs promote the source-
driven development approach and use the metadata
format that Salesforce DX uses.
2. With package versions, you have an immutable,
versionable artifact that can be used in CI, UAT, etc.
The same artifact that passes all your CI tests and
UAT can be installed in your production orgs.
3. DCPs promote modular development where you
can organize your functionality into logical, modular,
interdependent units, and use packaging for
deployment and organization. You get all the good
things that come with modular, iterative
development practices.
What are the benefits of DCPs over change sets and ANT Migration Tool?
Code
Develop + Unit Tests
QA
Code Merge + Functional
Test
UAT + Load + Staging
Release
Training + Deploy
Dev
SBX
PRODFull
SBX
Dev
SBX
Dev
SBX
Partial
SBX
Dev
Pro
SBX
Dev
Pro
SBX
Scratch
Org
Scratch
Org
Scratch
Org
参考例:Feature Development 2 ways
Declarative Development:
Code is promoted through
change sets, ant migration,
metadata API.
Version Control System (repo)
Source-Driven Development:
Changes are tracked in a VCS
with a CLI for source pull and
push, and programmatic
testing.
New Tools:
Salesforce DX delivers a suite
of tools and processes to
support modern
development and VCS.
CLI-driven changes
Change set promotions
デモ
Hello World
Hello DCPs
1. リポジトリをコピー
git clone
https://github.com/dreamhouseapp/dreamhouse-
sfdx.git
cd dreamhouse-sfdx/git
checkout spring18
2. Dev Hub 認証
sfdx force:auth:web:login –setdefaultdevhubusername
3. Developer-Controlled Package の作成
sfdx force:package2:create --name dreamhouse --
containeroptions Unlocked
4. sfdx-project.json の編集
"ihistd": "<0Ho ID that you got from step
3>","versionName": "Spring - 2018","versionNumber":
"1.0.0.NEXT" (see here for more info about version
numbers)
5. パッケージバージョンの作成
sfdx force:package2:version:create --directory force-app --wait
10
6. スクラッチ組織の生成
sfdx force:org:create --noancestors --nonamespace --
definitionfile config/project-scratch-def.json --setalias sub1 –
setdefaultusername
7. パッケージインストール
sfdx force:package:install --id <04t_id_from_step_5> --wait 10
8. パッケージの確認
sfdx force:org:open
“エラーを解決できません…”
AppExchange Packaging in Salesforce DX
Packaging
Org
Version
Control
System
Local Workspace with
IDE
Package
Dev
Scratch
Org
4. source:convert; mdapi:deploy
QA
Scratch
Org
1. mdapi:retrieve; mdapi:convert
DCPs in Salesforce DX(コマンドから推察)
Packaging
Org
Version
Control
System
Local Workspace with
IDE
Developer Control Pakcage
Dev
Scratch
Org
QA
Scratch
Org
Production?
まとめ
現時点でわかったこと
• Developer-Controlled Packages (DCPs) はSalesforce DXの⼀部として、メタデータを
展開するための新しい⽅法
• 企業向けのユースケースを考慮して設計された新しいタイプのパッケージ
• 例:プロダクション組織の既存のパッケージ化されていないメタデータを整理する
• 変更セットとANT移⾏ツールと⽐較して⽣産性、利便性にメリットがある
• Springʼ18 ではオープンベータ版
関連リソース
ドキュメント ブログ 動画
Salesforce DX Success Community
Salesforce DX Developer Center Web Site
Salesforce DX Developer Guide
Salesforce CLI Command Reference
Salesforce CLI Guide to Usernames and
Orgs
Salesforce CLI Guide to Authorization
Salesforce Metadata API Developer Guide
Develop Second-Generation Packages
(Beta)
Announcing Developer Controlled
Packaging (DCP) Beta
https://developer.salesforce.com/blogs/20
18/02/announcing-developer-controlled-
packaging-dcp-beta.html
New Spring ʼ18 Developer Features and
the DreamHouse Sample App
https://developer.salesforce.com/blogs/20
18/01/new-spring-18-developer-features-
dreamhouse-sample-app.html
Webinars:
Simplify your code with Salesforce DX and
module development
https://developer.salesforce.com/events/
webinars/simplify-your-code-with-
Salesforce-DX
Salesforce DX Product Manager AMA
https://developer.salesforce.com/events/
webinars/Salesforce-DX-AMA
次のステップ
Action
関連リソースのチェック
Hello World を試してみる(ライセンス使えない場合はご連絡ください)
コミュニティに投稿(オンラインもオフラインでも)
https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F93A000000Lg5U
事例の共有(部分的でも嬉しいです!)
Developer-Controlled Packages (DCPs) を試してみた

Developer-Controlled Packages (DCPs) を試してみた