From 529d49270dbf9a8dd17f9f79499bc23e61feaefe Mon Sep 17 00:00:00 2001 From: vmsharoshkin Date: Tue, 18 Aug 2026 12:43:35 +0300 Subject: [PATCH] fix: double deploy --- CLAUDE.md | 4 ++-- README.md | 22 ++++++++++++++-------- cmd/app.go | 6 +++--- skill/SKILL.md | 4 ++-- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index de08096..ddcc1a0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -20,8 +20,8 @@ The CLI is explicitly designed to be **agent-friendly**: every command has stable `--json` output, config comes from env vars, and `skill/SKILL.md` documents the CLI's contract for AI agents driving it. The primary agent-facing scenario is *ship a vibe-coded app*: `eds repo create` + -`git push` gets code hosted, `eds wf app create` + `eds wf app deploy` -publishes it, and `eds wf app status` (or the lower-level `eds wf run`/ +`git push` gets code hosted, `eds wf app create` publishes it (auto-deploy +on create), and `eds wf app status` (or the lower-level `eds wf run`/ `eds wf job`) tracks the rollout. ## Commands diff --git a/README.md b/README.md index b2a0f14..4c9f6c0 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ eds repo show show repository details eds repo delete [--force] delete a repository eds repo clone [dir] [--ssh] clone via local git CLI -eds wf app create --repository R|--repository-url URL --branch B create a Workflow Studio application +eds wf app create --repository R|--repository-url URL --branch B create and auto-deploy a Workflow Studio application eds wf app list list applications eds wf app show show application details eds wf app update --branch B [--name N] update name/branch @@ -185,13 +185,19 @@ eds repo clone my-site && cd my-site # ...add code + Dockerfile... git add . && git commit -m "init" && git push origin main -# 2. Wire it to a Workflow Studio application -APP_ID=$(eds wf app create my-site --repository my-site --branch main --json | jq -r '.id') - -# 3. Publish it -eds wf app deploy "$APP_ID" --json | jq -r '.run_id' - -# 4. Poll status until it's done, then read the live URL +# 2. Wire it to a Workflow Studio application. Creating it auto-triggers the +# first deploy — you don't need a separate `deploy` call right after create. +APP_ID=$(eds wf app create my-site --repository "$REPO_ID" --branch main --json | jq -r '.id') + +# 3. Poll until it's actually live. Check application.status (not just run +# status) because "publishing" can last well after the run already reports +# "done". +for i in $(seq 1 20); do + STATUS=$(eds wf app status "$APP_ID" --json | jq -r '.application.status') + echo "status: $STATUS" + [ "$STATUS" = "running" ] || [ "$STATUS" = "error" ] && break + sleep 15 +done eds wf app status "$APP_ID" --json | jq '{status: .application.status, url: .latest_deployment.url}' ``` diff --git a/cmd/app.go b/cmd/app.go index ea76c40..dd61e3c 100644 --- a/cmd/app.go +++ b/cmd/app.go @@ -43,11 +43,11 @@ func newAppCreateCmd() *cobra.Command { Use: "create ", Short: "Create a Workflow Studio application from a repository", Args: cobra.ExactArgs(1), - Long: `create wires a repository + branch to a deploy pipeline. + Long: `create wires a repository + branch to a deploy pipeline and +immediately triggers the first deployment. The repository can be an existing "eds repo" repository (--repository, -accepts either its id or its name) or an external git URL (--repository-url). -Use "eds wf app deploy" afterwards to actually run the pipeline and publish.`, +accepts either its id or its name) or an external git URL (--repository-url).`, Example: ` eds repo create my-site && eds wf app create my-site --repository my-site --branch main eds wf app create my-site --repository-url https://github.com/user/my-site --branch main`, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/skill/SKILL.md b/skill/SKILL.md index f4af969..68655b6 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -59,7 +59,7 @@ Errors go to stderr and the process exits non-zero. | `eds repo show [--json]` | Show details: id, default_branch, size, clone URLs | | `eds repo delete [--force] [--json]` | Delete (irreversible; requires confirmation unless `--force`) | | `eds repo clone [dir] [--ssh] [--target DIR]` | Clone via local `git` CLI | -| `eds wf app create --repository R\|--repository-url URL --branch B [--json]` | Create a Workflow Studio application from a repo + branch | +| `eds wf app create --repository R\|--repository-url URL --branch B [--json]` | Create a Workflow Studio application from a repo + branch (auto-triggers first deploy) | | `eds wf app list [--search S] [--sort created_at_asc\|created_at_desc] [--json]` | List applications | | `eds wf app show [--json]` | Show application details (status, run_id, pipeline_id, ...) | | `eds wf app update --branch B [--name N] [--json]` | Update an application's name/branch | @@ -308,7 +308,7 @@ eds repo list --json | jq '.repositories[].name' # 3. write NEW_REPO=$(eds repo create my-app --json | jq -r '.id') -# 4. deploy +# 4. deploy (create auto-triggers the first deploy) APP_ID=$(eds wf app create my-app --repository "$NEW_REPO" --branch main --json | jq -r '.id') eds wf app status "$APP_ID" --json | jq '{status: .application.status, url: .latest_deployment.url}' ```