Question for post-deploy phase: We want to run a s...
# seed
l
Question for post-deploy phase: We want to run a specific command only on the first successful build. Currently we’re using SEED_BUILD_ID = 1 as a trigger, but if the first build is failing for whatever reason we never trigger our desired command. Anyone faced a similar challenge / has an idea around this? Thanks 🙂
f
Hey @Luca Demmel, I think we can add an environment variable that shows the last successfully deployed build.
Let me talk to the team.
In the meanwhile, here r some options i can think of: • For SLS projects, u can do a
sls info
to check if a service has been deployed in
before_deploy
, and run the command in
after_deploy
, down side of this is that it’s not done inside Post Deploy Phase. • Track the state in Post Deploy Phase. For example, in Post Deploy Phase, look up if an SSM parameter ie.
/deployStatus/$stage
exists. If it’s not it’s the first successful deploy, and creates the SSM. It doesn’t have to be an SSM key, it could be an S3 file that tracks the state.
l
Hey Frank, thank you. While I wait for the update of the env var, we’ll check out your suggestions 🙂