-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deployment apply -y option #1135
deployment apply -y option #1135
Conversation
@CAGS295: This would be very helpful toggle, for sure! 👏🏽 Thank you for your contribution. One of the Clarinet team members will review and collaborate with you shortly. Please also share how Clarinet is running in your infra; any info about CI/CD automation can be helpful context. With that, we can explore additional optimizations in this workflow and unlock advanced use cases. |
This is my toy example: #!/usr/bin/env bash
set -eou >/dev/null
API_URL=http://localhost:3999/v2/info
DEV_READY_HEIGHT=137
clarinet integrate --no-dashboard >/dev/null &
CLARINET_PID=$!
echo "clarinet PID $CLARINET_PID"
# Wait until API is up
echo "Waiting on Stacks API"
while ! curl -s $API_URL >/dev/null; do
sleep 1
done
echo "Waiting on burn block height $DEV_READY_HEIGHT"
#Wait until devnet is ready, epoch 2.4?.
while [ "$(curl -s $API_URL | jq '.burn_block_height')" -lt $DEV_READY_HEIGHT ]; do
sleep 2
done
# Apply extra deployments
clarinet deployment apply -p integration/deployments/bootstrap.devnet-plan.yml
#Run tests
yarn test
kill -s INT $CLARINET_PID |
@CAGS295: This is very helpful! Many thanks for the clarification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @CAGS295! The -y
option could be confusing, what's your take on replicating the behavior we have in some other subcommands?
/// Use on disk deployment plan (prevent updates computing)
#[clap(
long = "use-on-disk-deployment-plan",
short = 'd',
conflicts_with = "use-computed-deployment-plan"
)]
pub use_on_disk_deployment_plan: bool,
/// Use computed deployment plan (will overwrite on disk version if any update)
#[clap(
long = "use-computed-deployment-plan",
short = 'c',
conflicts_with = "use-on-disk-deployment-plan"
)]
pub use_computed_deployment_plan: bool,
good. If we can settle on a long option, picking the short one should be straightforward. I do lean towards concise long options. Nobody likes flooding the console with many long options. |
baee07d
to
3b37622
Compare
3b37622
to
4a2f4a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A skip prompt does not seem like a good idea to me. /// Use on disk deployment plan (prevent updates computing)
#[clap(
long = "use-on-disk-deployment-plan",
short = 'd',
conflicts_with = "use-computed-deployment-plan"
)]
pub use_on_disk_deployment_plan: bool,
/// Use computed deployment plan (will overwrite on disk version if any update)
#[clap(
long = "use-computed-deployment-plan",
short = 'c',
conflicts_with = "use-on-disk-deployment-plan"
)]
pub use_computed_deployment_plan: bool, So if a developer wants to skip prompt, they chose the right flag for forcing the usage of the deployment on disk, or the computed plan. |
d28a46b
to
0d648e6
Compare
0d648e6
to
9593725
Compare
@CAGS295 Can you sign the CLA please? #1135 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, this enhancement is going to be super useful! Thank you @CAGS295 for bearing with me :)
Description
The user prompt to confirm a
clarinet deployments apply
makes it hard to use in automated scripts. Adding an option '-y' to pre-accept the deployment would allow users to automate deployments.