I wonder if there is anyway to hook up the atlantis plan to specific slack channel? Thanks!
This would be awesome! I would prefer to do it natively in atlantis, however, as a workaround we wrote this do it from our other CI/CD pipelines: https://github.com/cloudposse/slack-notifier
You can add this as a run step in the atlantis.yaml
If you happen to use GitHub you should be able to use GitHub + Slack Integration to command Atlantis from Slack. At least the feature list says:
Attach a message as a comment to an existing issue or pull request
I am going to test it when our HipChat to Slack migration is ready.
I often feel like github + slack integration send more noise than signal. That is why I want to build the notifications part of the atlantis flow.
There is an undocumented way to do this. It's undocumented because the API isn't finished and I don't plan to do more work on it so I don't want to document it and then get a bunch of issues around it.
That being said, here's how it works:
atlantis server --config=config.yamlconfig.yaml with:yaml
slack-token: <token>
webhooks:
<ul>
<li>event: plan<br />
workspace-regex: .*<br />
kind: slack<br />
channel: your-channel<br />
@lkysow That seems pretty interesting. 馃槃
Think that will work for you?
I did not try it, I will do it on weekend to see how it works out.
Hi @ikysow, i tried implementing the config.yaml way you mentioned above and i am afraid this does not work, always gives an error "Error: invalid config: reading config.yaml: open config.yaml: no such file or directory" even though i have created a config.yaml in the following format :
slack-token: xoxp-xxxxxxxxxxxxx-xxxxxxxx
webhooks:
Any inputs would be useful. Thanks.
The error is saying that that file does not exist. The file needs to be where atlantis server is running. Where are you running Atlantis? When you pass --config=path/to/config/file does this file exist?
Hi @ikysow .. Thank you for the quick revert!! I am running the atlantis server on an ec2 instance as a docker container. However, i have created a file config.yaml with the tokens mentioned above, but still for some funny reason get "no such file or directory".. Something really strange.
i use the parameter --config=path/to/config/file while starting the atalntis server, the container exits with the above mentioned log error message.
Is the yaml file mounted into the docker container? You're getting that error because Atlantis can't find the file at the path you're giving it.
Hey @ikysow Thanks for getting back, i have copied the config.yaml as part of my dockerfile and built an image. Even after doing that i was getting this error. Hence found it a strange behaviour.
One of the steps within my dockerfile :
COPY config.yaml /home/atlantis/config.yaml
Post which running the container passing --config=/home/atlantis/config.yaml -----> gives the same error, no such file or directory.
Any suggestions?
Hi @ikysow, got this working. But getting this message :
Error: initializing server: initializing webhooks: "event: plan" not supported. Only "event: apply" is supported right now
It says plan is not supported. I am running atlantis server with the latest version.
Any suggestions ? Thanks
The plan event is not supported unfortunately.
Yup was reading through a couple of blog posts where i could find content related to atlantis and came across this. Any reason why "plan" is not supported? It would be an amazing feature.
As a workaround i am using the github/slack integration with comments, reviews all turned on to subscribe per repository.
Would be a wonderful feature if plan is implemented as part of the event scenario.
There's no good reason. The slack integration was done during a hackathon at my previous company so the API isn't necessarily well designed and it's not feature complete.
As I mentioned above though:
There is an undocumented way to do this. It's undocumented because the API isn't finished and I don't plan to do more work on it so I don't want to document it and then get a bunch of issues around it.
Most helpful comment
There's no good reason. The slack integration was done during a hackathon at my previous company so the API isn't necessarily well designed and it's not feature complete.
As I mentioned above though: