`wrangler versions` commands are tricky to automate because of IDs
Describe the solution
The current iterations of the wrangler versions commands seem really geared towards interactive usage only. If I want to do a new deployment with a secret, I must do the 3 step dance:
wrangler versions uploadwrangler versions secret putwrangler versions deploy
Step 2 allows passing no id, and it will use the latest version from step 1, so that's fine, although explicitly expressing "latest" might be nice.
Step 3 however requires I either select the version interactively or pass in an ID. Currently we must either extract the id from the output of step 2, or run wrangler versions list and extract the id, which is very awkward in bash. A few things could make this easier:
- let me use
latestas an alias for an id - allow using tags or an ID I generate to select a specific version instead of the CF generated id
- if
--yesoption is used with no version id, assume the user means latest (similar to other commands) - add flags that make the output simpler, or even write to a file, so its easier to get ids without needing sed/awk or involving JS
Sidenote - allowing me to deploy with secrets attached in one step would let me avoid this altogether.
Thanks for the issue @theoephraim. These are good points and we will investigate the best solution here.
+1 just started implementing a bunch of monkey business around wrangler versions upload | tee deploy.txt ... making this easier would be great. I personally can't use latest because we have a high volume of preview deploys running through CI/CD all day, but agree that would be nice-to-have.
The suggestion from #10933 would solve my use case even better so I can reuse a build version as my tag and refer to the the active deployment that way!
One more papercut - if you provide --version-id 12345 without --yes, even in a script, wrangler puts up an interactive selection of versions to choose from
@sodabrew - https://github.com/cloudflare/workers-sdk/issues/5709
I personally can't use
latestbecause we have a high volume of preview deploys running through CI/CD all day
Great point - allowing end users to pass in an ID/tag would be much better.