formica
formica copied to clipboard
Proposal: `--detailed-exitcode` option
For scripting use cases where I've got a CI system that I want to raise a status for different changeset states.
Example:
formica change -c dev-env.config.yml
STATE=$(aws cloudformation describe-change-set --stack-name ${STACK} --change-set-name ${STACK}-change-set --query ExecutionStatus --output=text)
if [[ $STATE == "AVAILABLE" ]] ; then formica deploy -c dev-env.config.yml ; fi
Really what I want is a structured output that I can jp
or jq
into telling me: how many resources have changed, whether the changeset has any changes, and the state of the changeset. The awscli command above only does the latter, and I don't want to blindly formica deploy
and have it fail if there are no changes in the changeset.
Hmm so I assume the use case is you have template files in a repo with app code, you want to first go through deploying the templates and once those pass deploy the app code. If there are no changes in the template though you want to go through change
and deploy
successfully so the app deployment steps can run successfully.
To solve this we could simply add an argument to change
that makes it succeed if there are no changes in the changeset. Then in deploy another argument that ignores unavailable change sets but doesn't fail.
Or is there are more comprehensive use case for this? I don't want to add any machine readable output, the awscli does that already (also gives you the List of Changes).
But I definitely want something like this in, otherwise its not usable for the use case I described in CI, which is bad.