https://pulumi.com logo
#general
Title
# general
t

tall-crowd-93084

05/12/2023, 1:12 PM
Hi folks, I'm having a bit of trouble with Command. I have this to generate .env file which are deployed with ansible:
Copy code
const renderEnvCmd = new command.local.Command(`${customer.subDomain}-env`, {
    create: `
      mkdir -p ansible/${customer.subDomain} && \
      cat ansible/env.tmpl | envsubst > ansible/${customer.subDomain}/.env`,
    environment: {
      ...secrets,
      ...postGres,
      BASE_PATH,
      anonJWT,
      serviceJWT,
      smtpPass: cfg.requireSecret("sendinblueSMTP"),
      fqdn: customerDNS,
    },
  });
I'm not sure why, but my .env files aren't being regenerated... Do I have to wire this up in any particular way to make sure the command is evaluated/exectued?
Ah I think I might have figured it out. I need to put one of the output into the stack rather than the command itself edit nope - that's not it
w

white-balloon-205

05/12/2023, 2:55 PM
What should cause this to rerun? Is there an output from something else that will change to indicate this needs to rerun? You can use the
triggers
property to indicate what triggers should cause this to run. Any change to the values you pass to triggers will cause a recreation of the command, which will re-run its create.
4 Views