https://pulumi.com logo
#python
Title
# python
c

colossal-room-15708

11/03/2019, 10:44 PM
I'm running some docker commands (build image, login to ACR, push image) in my pulumi script and gotten over the fact that they don't show up as resources (which is fine for now). However, the login command for example needs the ACR repository name, user name and password, which are outputs from pulumi resources. The docker commands run during preview already which means the outputs have no value which causes the docker commands to fail. Is there any way to make this work?
w

white-balloon-205

11/03/2019, 11:57 PM
You can have the commands only run during an update by using
pulumi.runtime.is_dry_run()
. You can also put the calls to run
docker
commands inside applies to have them only run once known values are provided. In the JavaScript docket package, I believe both of these are used to build the image every time, but to only push during updates (not previews).
c

colossal-room-15708

11/04/2019, 7:35 AM
Thanks Luke. I'll give that a go.