Notifications on nightly build failures

circle.yml
2.0

#1

We use the nightly feature of Circle 2.0 to run tests nightly. We would like to receive a Slack notification for this nightly build if it fails, without turning on Slack notifications for all builds or workflows. We are using CircleCI Enterprise. Is this possible?

Sample of our config.yml:

  nightly:
    triggers:
      - schedule:
          cron: "0 11 * * *"
          filters:
            branches:
              only:
                - master
    jobs:
      - run_all_tests

#2

As far as I know, nightly is a word of your choosing, so there’s no “nightly” feature, as such. You’re using the schedule feature, which in your case runs at 11am every morning (based on East-coast US server time, I would guess).

I don’t think your selective notifications are possible out of the box, but you could look at the Circle API. You could scan that with a script and push a message to Slack if it finds a recent failed build. That could be run as another scheduled build process in Circle, in fact.

Actually, that may be over-complicating it. You could just run something inside the same build process to send you a Slack message on failure. The only minor issue here is detecting that the build has been done on the nightly trigger rather than on push - you could use the time to detect that.


#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.