Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional notification #10

Open
syucream opened this issue Jun 7, 2018 · 1 comment
Open

Conditional notification #10

syucream opened this issue Jun 7, 2018 · 1 comment

Comments

@syucream
Copy link

syucream commented Jun 7, 2018

I'd like to notify terraform cmd result to slack only when it fails. I think we can implement it as a conditional notification function, like below:

---
ci: circleci
notifier:
  slack:
    token: $SLACK_TOKEN
    channel: $SLACK_CHANNEL_ID
    bot: $SLACK_BOT_NAME
terraform:
  plan:
    filters:
      only:
        - failed  # notify when terraform-plan failed
    template: |
      {{ .Message }}
      {{if .Result}}
      ```
      {{ .Result }}
      ```
      {{end}}
      ```
      {{ .Body }}
      ```

Do you have any opinion? And I try to implement a patch as PoC if you have no problem.

@babarot
Copy link
Contributor

babarot commented Jun 12, 2018

@syucream Thank you for your suggestion.

It's good idea! (I thought that it should be implemented in the near future 😉) But YAML (struct) format should seem to be considered a bit more.

And I try to implement a patch as PoC if you have no problem.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants