Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated Apr 30, 2024

Maintenance ModeYou are viewing Amplify Gen 1 documentation. Amplify Gen 1 has entered maintenance mode and will reach end of life on May 1, 2027. New project should use Amplify Gen 2. For existing Gen 1 projects, a migration guide and tooling are available to help you upgrade. Switch to the latest Gen 2 docs →

サンドボックス環境

これで、クラウドに2つの独立した環境(mainとdev)と、Git上のAmplifyバックエンドインフラストラクチャコードに対応するgitブランチが完成しました。チームメンバーが同じAmplifyプロジェクトで作業し、機能を追加してからdev環境にプッシュして変更をテストしたいとします。以下の手順を実行します。

$ git clone <git-repo>
$ cd <project-dir>
$ git checkout -b mysandbox
$ amplify env add
? Do you want to use an existing environment? No
? Enter a name for the environment mysandbox
// 初期化ステップの残り
// amplify add/update <category>を使用してバックエンド設定を追加/更新
$ amplify push
$ git push -u origin mysandbox

次に、チームメンバーがこれらの変更をdevおよびmain環境/ブランチに移動したいとします。

$ git checkout dev
$ amplify env checkout dev
$ git merge mysandbox
$ amplify push
$ git push -u origin dev

devステージですべてが正常に機能することをテストした後、devをmainのgitブランチにマージできます。

$ git checkout main
$ amplify env checkout main
$ git merge dev
$ amplify push
$ git push -u origin main

このアプローチでは、gitブランチ(devとmain)をソースオブトゥルースと見なすことができ、すべてのチームメンバーはブランチから作業し、ワークスペースを同期させておく必要があります。