I have a makefile with this goal:
setup:
@GHE_TOKEN=$(shell vault read -field=value is/cloud/eng/ghe_token)
@GHE_TOKEN=${GHE_TOKEN} pipenv install --dev
What I'm doing here is getting a secret from HashiCorp vault and passing it on to the next command. This works fine if I'm already logged in to vault properly.
However if I'm not logged in the pipenv install command proceeds even though there was an error in vault read.
So what I'm looking for is the make goal to abort and display the error message if there is an error on the vault read call and also be able to capture the output of a successful shell command to read. I know how to do one or the other, but not both.
Thanks for any help!
makerecipe will be executed in separate shells. So the value ofGHE_TOKENset in the first command will not be visible in the second.