Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
スクラッチ組織活用術 Salesforce Developers Meetup #24
Search
omiend
November 13, 2020
Technology
0
1.3k
スクラッチ組織活用術 Salesforce Developers Meetup #24
スクラッチ組織活用術
Salesforce Developers Meetup #24
omiend
November 13, 2020
Tweet
Share
More Decks by omiend
See All by omiend
Nuxt.jsのComponent分割単位と,SSRをする上で気をつけること
omiend
1
780
Nuxt.js_Vue.js_のVuexの動かしかたをまとめてみたよ.pdf
omiend
0
120
20181208_好きだけじゃツライScala.js_共有版_.pdf
omiend
0
120
20181110 Scala関西Summit 懇親会LT「Scalaのかわいいところ」
omiend
0
510
Other Decks in Technology
See All in Technology
ecspressoの設計思想に至る道 / sekkeinight2025
fujiwara3
12
2.1k
AI エンジニアの立場からみた、AI コーディング時代の開発の品質向上の取り組みと妄想
soh9834
8
590
P2P ではじめる WebRTC のつまづきどころ
tnoho
1
270
なぜAI時代に 「イベント」を中心に考えるのか? / Why focus on "events" in the age of AI?
ytake
2
800
TypeScript 上達の道
ysknsid25
23
4.8k
Shadow DOM & Security - Exploring the boundary between light and shadow
masatokinugawa
0
760
株式会社島津製作所_研究開発(集団協業と知的生産)の現場を支える、OSS知識基盤システムの導入
akahane92
1
1.3k
Bliki (ja), and the Cathedral, and the Bazaar
koic
8
1.5k
Jitera Company Deck / JP
jitera
0
250
Step Functions First - サーバーレスアーキテクチャの新しいパラダイム
taikis
1
280
Power Automate のパフォーマンス改善レシピ / Power Automate Performance Improvement Recipes
karamem0
0
270
クマ×共生 HACKATHON - 熊対策を『特別な行動」から「生活の一部」に -
pharaohkj
0
180
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
337
57k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
530
Typedesign – Prime Four
hannesfritz
42
2.7k
KATA
mclloyd
30
14k
GitHub's CSS Performance
jonrohan
1031
460k
Adopting Sorbet at Scale
ufuk
77
9.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
The Cost Of JavaScript in 2023
addyosmani
51
8.6k
Art, The Web, and Tiny UX
lynnandtonic
301
21k
Transcript
アルプ株式会社 @omiend スクラッチ組織活用術 Salesforce Developers Meetup #24
自己紹介 オミ@omiend 仕事: アルプ株式会社。 Scala が好き。 Salesforce は2011年~2015年に Force.com を中心に開発。
1月にアルプへ入社して、5年ぶりの Salesforce 開発。 浦島太郎状態。 趣味: ジョギング、ウォーキング、映画、音楽
Scalebase - アルプ株式会社
Scalebase Connect for Salesforce
alp.connpass.com 2020年12月11日(金) 19:00 ~ 田中宏樹さま - 株式会社セールスフォース・ドットコム Salesforce の最新の開発事情 相野谷直樹さま
- アルプ株式会社 Modern Salesforce CI pattern (ただし第1世代パッケージ管理)(仮) 木村篤彦さま - 株式会社co-meeting Salesforce連携アプリ開発パターン(仮) 松田淳司さま - 株式会社ZAICO はじめてのAppExchange ~ZAICO for Salesforceのリリースに挑む ~ SaaS * Salesforce Developers Winter 2020
スクラッチ組織活用術
課題
課題 Salesforce開発は、組織がどんどん増えていく - 本番環境、Sandbox環境*n 用途の為に都度Sandbox環境を作る運用は結構つらい - 作成がちょっと煩雑 - 管理も職人芸になっていく -
メンテ漏れ 自分だけの開発環境が欲しい スクラッチ組織というとても便利な物がある - DevHub組織さえ有効化すればOK
スクラッチ組織を作成する
スクラッチ組織の作成 $ sfdx force:auth:web:login -d -a DevHub $ sfdx force:alias:list
=== Alias List Alias Value ──────────── ────────────────────────── DevHub
[email protected]
$ sfdx force:org:create \ -f ./config/project-scratch-def.json \ --setdefaultusername \ -a
MyScratchOrg \ --targetdevhubusername DevHub \ --durationdays 30 スクラッチ組織の作成
$ sfdx force:org:create \ -f ./config/project-scratch-def.json \ --setdefaultusername \ -a
MyScratchOrg \ --targetdevhubusername DevHub \ --durationdays 30 スクラッチ組織の作成
スクラッチ組織の作成 { "edition": "Developer", "orgName": "SomeOrgName", "adminEmail": "
[email protected]
", "username": "
[email protected]
",
"features": ["API"] } .project/config/sample-project-scratch-def.json
ソースコードをデプロイする
sfdx force:source:deploy \ -u MyScratchOrg -m ApexClass,... ソースコードをデプロイする
テストデータを作成する
テストデータを作成する $ sfdx force:data:tree:import \ -p .project/data/Account-plan.json \ -u MyScratchOrg
$ sfdx force:data:tree:import \ -p .project/data/Account-plan.json \ -u MyScratchOrg テストデータを作成する
[ { "sobject": "Account", "saveRefs": true, "resolveRefs": false, "files": [
"Accounts.json" ] } ] テストデータを作成する
{ "records": [ { "attributes": { "type": "Account", "referenceId": "A"
}, "Name": "アルプ株式会社 ", "BillingPostalCode": "1086022", "BillingCountry": "日本", "BillingState": "東京都", "BillingCity": "港区", "BillingStreet": "港南 2-15-1 品川インターシティA棟 22階 SPROUND", "ShippingPostalCode": "1086022", "ShippingCountry": "日本", "ShippingState": "東京都", "ShippingCity": "港区", "ShippingStreet": "港南 2-15-1 品川インターシティA棟 22階 SPROUND" } ] } テストデータを作成する
標準ユーザーを作る
$ sfdx force:user:create \ --setalias StandardUser \ --definitionfile ./config/project-scratch-standart-user-def.json 標準ユーザーを作る
$ sfdx force:user:create \ --setalias StandardUser \ --definitionfile ./config/project-scratch-standart-user-def.json 標準ユーザーを作る
標準ユーザーを作る { "Username": "
[email protected]
", "LastName": "Standard", "Email": "
[email protected]
", "profileName": "標準ユーザ",
"generatePassword": true } .project/config/sample-project-scratch-standard-user-def.json
スクラッチ組織に ログインする
$ sfdx force:org:open -u MyScratchOrg $ sfdx force:org:open -u StandartUser
スクラッチ組織にログインする
パスワードを作成する
$ sfdx force:user:password:generate -u MyScratchOrg Successfully set the password "qwerty"
for user
[email protected]
. パスワードを作成する
作成したユーザーの 詳細を参照する
$ sfdx force:user:display -u MyScratchOrg 作成したユーザーの詳細を参照する
など など etc etc
コマンドをたくさん 叩くのがつらい!
sfdx コマンドは shell に組み込める
勝ったな
スクラッチ組織の作成
注意点 - 名前空間を利用している場合、スクラッチ組 織作成時の設定ファイルで指定してあげる 必要がある( "namespace": "hoge", )。 - スクラッチ組織作成時のユーザー名は、一意
になるように、都度書き換える必要がある。 - テストデータを作成する際、一意の値は都度 書き換える必要がある(Account.Name に 指定する値など)。
Salesforce Winter '21
Salesforce Winter ‘21 releasenotes.docs.salesforce.com/ja-jp/winter21/release-notes/rn_forcecom_development.htm
- 弊社のプロダクトは主にAppExchangeのパッケージ 開発。 - ソースコードはGitHub管理しており、第2世代パッ ケージ管理を目指している(まだ対応できていない)。 - パッケージ作成を行う組織(一般的には SourceOrg?)のシェイプを作成し、そこからスクラッ チ組織を作成するみたいな機能かと思うが、上記の
点でマッチしなかった。 - ズビバゼン Salesforce Winter ‘21
より快適な スクラッチ組織ライフ を目指して
Scalebase Connect for Salesforce - GitHub Actions にてスクラッチ 組織を作成し、テストを実行 -
この辺は弊社主催の「SaaS * Salesforce Winter 2020」にて ご紹介できるかも
alp.connpass.com 2020年12月11日(金) 19:00 ~ 田中宏樹さま - 株式会社セールスフォース・ドットコム Salesforce の最新の開発事情 相野谷直樹さま
- アルプ株式会社 Modern Salesforce CI pattern (ただし第1世代パッケージ管理)(仮) 木村篤彦さま - 株式会社co-meeting Salesforce連携アプリ開発パターン(仮) 松田淳司さま - 株式会社ZAICO はじめてのAppExchange ~ZAICO for Salesforceのリリースに挑む ~ 【再掲】SaaS * Salesforce Developers Winter 2020