This message was deleted.
# atlantis-community
s
This message was deleted.
o
What if you need to rebuild packer image without any changes of TF/TG code? Just ad-hoc, because… Let’s say you need to fix vulnerability?
I’m wondering, if Atlantis would have a possibility to run ad-hoc jobs, it might be possible to use it for something like Ansible too
j
@Oleg Gumbar For this particular use case, I always want my deployment to be using the most recent packer image. If I rebuild the image, I want to immediately deploy it always. If a rare case came up where I wanted to rebuild the image without actually running the terraform, I'd just monkey-patch by running the packer build locally with
--force
and update the disk image with the same name.
it's GCP compute, so if even if the terraform code doesn't change, if the latest image in the image family changes, it will deploy those instances
p
can you just not output to stdout and it will show in your container logs?
or have rsyslog to catch a specific level and file and read them that way?
j
@PePe Amengual Atlantis server doesn't write workflow hook output to stdout. However, redirection of command output does work . (So I can get output that my script produces, but not the errors in the bash shell that ran the script)
p
so if the shell session fails with an error because your script have
set -e
you do not get anything?
j
Currently I'm redirecting to a file, and it's awkward to go check it. But I did just stumble on this github issue that has a great solution. Use the stored github credential to make an API call to write the output to the PR comments
it's a python script, not bash. But my understanding is
set -e
still won't produce any viewable output because they are running workflow hooks with the golang equivalent of
subprocess.run()
and aren't directing the stdout results anywhere
p
I see ok
I think that will have to be added as an improvement but we have no plans to add it right now unless that it comes as a community contribution
👍 1
j
It's some labor to add some extra exception handling, but it's doable, and the suggestion from that issue seems to be a good gitops way of doing it
👍🏽 1
For anyone interested in the resolution of this, looks like atlantis sends workflow hook bash output to stderr. So adding
2>&1
to any command that's being redirected to file will capture the full output of the hook execution.
👍🏽 1