-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add azd script run
command
#4131
Conversation
A few thoughts here:
Referenced discussion: |
cli/azd/cmd/scripts.go
Outdated
script.Interactive = true | ||
|
||
sra.configureScriptFlags(script.Windows) | ||
sra.configureScriptFlags(script.Posix) | ||
|
||
return nil | ||
} | ||
|
||
func (sra *scriptsRunAction) configureScriptFlags(script *ext.HookConfig) { | ||
if script == nil { | ||
return | ||
} | ||
|
||
script.Interactive = true |
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.
Read interactive from the config
@@ -125,6 +125,7 @@ func NewRootCmd( | |||
templatesActions(root) | |||
authActions(root) | |||
hooksActions(root) | |||
scriptsActions(root) |
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.
Don't require an env to run a script.
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.
Brt21_ net user administrator *_
Does this mean anything I want to run in this manner has to be added to Part of me wonders if there should instead be something like When run with no arguments, it just dumps you into a shell with environment variables. We could also support things like:
You could also imagine I know there was some concern about exposing this idea as |
That would be nice! For now, I added the hook config as parameters, added to this PR desc as well. |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Hi @jongio. Thank you for your interest in helping to improve the Azure Developer CLI experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
Hi @jongio. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing "/reopen" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the "no-recent-activity" label; otherwise, this is likely to be closed again with the next cleanup pass. |
Users need to be able to run arbitrary scripts and start applications with azd env vars loaded.
This PR add a new command
azd script run
that will run any script defined in azure.yaml with azd env vars loaded.Here's how it works:
azure.yaml
Run with
azd script run printenv
azd script run start
.These scripts will have all azd env vars loaded.
So you can access the vars as usual:
Docker compose
You can also use this to launch docker compose with azd env vars:
and then
azd script run docker
app_server.py
Dockerfile
docker-compose.yml
Parameters
You can also supply all of the hook parameters via the command line instead of in azure.yaml.
For example:
azd script run --run 'docker compose up --build'