nullstone-io / nullstone

Nullstone is a customizable developer platform launched on your cloud accounts.
https://nullstone.io
MIT License
39 stars 1 forks source link

Wait for launch #186

Closed BSick7 closed 7 months ago

BSick7 commented 7 months ago

This PR adds a wait command to the CLI. This allows a user to run a blocking command to poll a workspace and wait for a workspace to launch.

This initial PR only supports nullstone wait --for=launched. We can add support for "deployed" and "destroyed" in a future PR.

Examples

Already provisioned

$ nullstone wait --for=launched --stack=cypress-realworld --env=dev --block=backend
Performing workspace command (Org=nullstone, Block=backend, Stack=cypress-realworld, Env=dev)

Workspace has launched already.

User cancelled

$ nullstone wait --for=launched --stack=cypress-realworld --env=dev --block=backend
Performing workspace command (Org=nullstone, Block=backend, Stack=cypress-realworld, Env=dev)

Waiting for "backend" to launch in "dev" environment...
Watching run for launch: https://app.nullstone.io/orgs/nullstone/stacks/2873/envs/947/blocks/2502/activity/runs/cb6d6f40-d033-4074-919d-2b59226b58a6
Timeout = 1h0m0s, Approval Timeout = 15m0s
^CUser cancelled operation
exit status 1

Waiting until success

$ nullstone wait --for=launched --stack=cypress-realworld --env=dev --block=backend
Performing workspace command (Org=nullstone, Block=backend, Stack=cypress-realworld, Env=dev)

Waiting for "backend" to launch in "dev" environment...
Watching run for launch: https://app.nullstone.io/orgs/nullstone/stacks/2873/envs/947/blocks/2502/activity/runs/e623cf14-5f2f-4df3-b3e5-e500b666649b
Timeout = 1h0m0s, Approval Timeout = 15m0s
Workspace launched successfully.