From ab0771a3068583559d71ad3b4bbceb2a8ef88ce0 Mon Sep 17 00:00:00 2001 From: Rafik Abdulwahab Date: Mon, 31 Aug 2026 16:02:25 +0200 Subject: [PATCH] FR-6422: Add start-first-deployments flags in create app and environment --- docs/cli.md | 4 ++++ internal/cmd/root/root_test.go | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/cli.md b/docs/cli.md index 33b9a55..fd01cd7 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -159,6 +159,8 @@ frbit apps create \ Use `--team` or `--payment-method` to select an accessible team or payment method. For the complete nested API payload, pass a JSON object with `--file`, or use `--file -` to read it from standard input. +Pass `--deploy` to start the initial deployment as part of creation. It requires Git configuration: `apps create` needs both `--repository` and `--branch`. Without `--deploy`, creating an app does not start a deployment. + ### Update an app ```sh @@ -205,6 +207,8 @@ frbit environments create \ --deploy ``` +Pass `--deploy` to start the initial deployment as part of creation. It requires `--branch` so the environment has a Git source. Without `--deploy`, creating an environment does not start a deployment. + Update the environment name or replace its deployment configuration: ```sh diff --git a/internal/cmd/root/root_test.go b/internal/cmd/root/root_test.go index bc463fe..cbc79cf 100644 --- a/internal/cmd/root/root_test.go +++ b/internal/cmd/root/root_test.go @@ -457,7 +457,9 @@ func TestEnvironmentWriteCommandsUseExpectedEndpoints(t *testing.T) { if err := json.NewDecoder(request.Body).Decode(&body); err != nil { t.Fatal(err) } - if body["appId"] != "ap-abc123" || body["name"] != "staging" || body["autoscaling"] != false { + deployment, _ := body["deployment"].(map[string]any) + git, _ := deployment["git"].(map[string]any) + if body["appId"] != "ap-abc123" || body["name"] != "staging" || body["autoscaling"] != false || git["branch"] != "main" || deployment["startFirstDeployment"] != true { t.Fatalf("create payload = %#v", body) } writer.WriteHeader(http.StatusCreated) @@ -503,7 +505,7 @@ func TestEnvironmentWriteCommandsUseExpectedEndpoints(t *testing.T) { defer server.Close() commands := [][]string{ - {"environments", "create", "--app", "ap-abc123", "--name", "staging", "--component", "php=sm", "--autoscaling=false"}, + {"environments", "create", "--app", "ap-abc123", "--name", "staging", "--component", "php=sm", "--autoscaling=false", "--branch", "main", "--deploy"}, {"environments", "update", "en-abc123", "--name", "preview"}, {"environments", "variables", "get", "en-abc123"}, {"environments", "variables", "update", "en-abc123", "--set", "APP_ENV=production"},