Skip to content

feat(cli): add --profile flag to deploy github command#181

Closed
alexvcodesphere wants to merge 3 commits intocodesphere-cloud:mainfrom
alexvcodesphere:feat/profile-flag
Closed

feat(cli): add --profile flag to deploy github command#181
alexvcodesphere wants to merge 3 commits intocodesphere-cloud:mainfrom
alexvcodesphere:feat/profile-flag

Conversation

@alexvcodesphere
Copy link
Member

Summary

Adds -p/--profile flag to cs deploy github for selecting a CI profile (e.g. prod for ci.prod.yml). Defaults to the standard ci.yml profile.

Important

Depends on #180 (which depends on #178) — merge those first.

Changes

  • cli/cmd/deploy_github.go — adds Profile opt + --profile/-p flag

Usage

# Default profile (ci.yml)
cs deploy github --stages 'prepare run'

# Custom profile (e.g. ci.prod.yml)
cs deploy github -p prod --stages 'prepare run'

Testing

  • make lint: 0 issues
  • make test: all tests pass
  • make build: compiles cleanly

Signed-off-by: Alex 132889147+alexvcodesphere@users.noreply.github.com

Refactor the standalone gh-action-deploy binary into two layers:

- pkg/deploy/: generic, provider-agnostic deployment engine
  (find, create, update, delete workspace + run pipeline)
- cli/cmd/deploy_github.go: GitHub-specific subcommand that reads
  GitHub Actions env vars and delegates to pkg/deploy

New commands:
  cs deploy          - parent command for CI/CD deployments
  cs deploy github   - GitHub Actions integration

The generic engine in pkg/deploy/ can be reused by future providers
(e.g. cs deploy gitlab).

Signed-off-by: Alex <132889147+alexvcodesphere@users.noreply.github.com>
Moves the pipeline polling logic (stage validation, IDE server checks,
allRunning, shouldAbort, deploy landscape sync) from cli/cmd/start_pipeline.go
into a shared pkg/pipeline package. Both start_pipeline.go and pkg/deploy
now use pipeline.Runner, eliminating duplicated and incorrect polling logic.

The deploy.Client interface now embeds pipeline.Client for shared pipeline
operations (StartPipelineStage, GetPipelineState, DeployLandscape).

The pipeline flow is: prepare → test (if present) → sync landscape → run.

Signed-off-by: Alex <132889147+alexvcodesphere@users.noreply.github.com>
Adds -p/--profile flag to 'cs deploy github' for selecting a CI profile
(e.g. 'prod' for ci.prod.yml). Defaults to the standard ci.yml profile.

Signed-off-by: Alex <132889147+alexvcodesphere@users.noreply.github.com>
@alexvcodesphere alexvcodesphere requested a review from a team as a code owner February 20, 2026 17:32
@alexvcodesphere
Copy link
Member Author

Reorganizing into cleaner PRs

@alexvcodesphere alexvcodesphere deleted the feat/profile-flag branch February 20, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant