02/04/2020, 9:57 PM
Question: is there any way in the pulumi command line to get the current active stack name (and for that matter project name) without making a network request to the server. So far I have, the following, but they are both very slow:
Copy code
PULUMI_STACK_TAGS="$(pulumi stack tag ls --json)"
PULUMI_PROJECT="$(echo "$PULUMI_STACK_TAGS" | jq -r .[\"pulumi:project\"])"
PULUMI_CONFIG="$(pulumi config --json --show-secrets)"
PULUMI_STACK_INFO="$(pulumi stack ls --json | jq '.[] | select(.current==true)')"
PULUMI_STACK="$(echo "$PULUMI_STACK_INFO" | jq -r .name)"
I realize there are command options, e.g., to just get a single stack tag, but doing so is just as slow so I might as well get all the tags at once and pull out what I need.