0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Salesforce Scratch Org 作業のデイリー・コマンドライン

Last updated at Posted at 2023-04-24

Salesforce Scratch Org 作業のデイリー・コマンドラインをメモ。

前提

  • Dev Hub 環境がすでに存在
  • Scratch Org 作業のための sfdx プロジェクトおよび git リポジトリがすでに存在
  • tiga0424a のような、日付とリビジョンをあらわす文字列を使用
    • git のブランチ名や Scratch Org 接続名に使用
  • Scratch Org は少なくとも日次で作成+廃棄
  • 記載のルールの多くは私の独自ルールであり、一般的なものではない

デイリー Dev Hub 作業

Scratch Org 作成から初回プッシュまで

まず Dev Hub にログインします。

sfdx org:login:web -d -a DevHub

(少なくとも1日に1回) Scratch Org を作成します。

sfdx force:org:create -f config/project-scratch-def.json -s -a tiga0424a

できたての Scratch Org に手元ソースを配備します。

sfdx force:source:push -u tiga0424a

Scratch Org の Web画面を開きます。

sfdx org:open -o tiga0424a

※さあ、どんどん開発しよう
※私の場合は、初回に権限セットへのユーザ割り当てを実施

開発成果をゲット

Scratch Org での開発作業が進んだら、良きタイミングにて開発成果ソースを取得します。

sfdx force:source:pull -u tiga0424a

※適宜 git に開発成果を反映

日々の作業終了時

日々の作業終了時には接続をすべて閉じます。

sfdx org:logout --all

※本当にすべての接続を切断してよいかどうかは都度判断すること。

フルセット

フルセットの手順は以下参照。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?