Webhooks and Build Notifications for Circle 2.0


#1

So webhooks were deprecated (why they would ever do this, doesn’t make sense to me)

I added these two steps which replicate the old webhooks as needed. Hope this helps!

      - run:
           name: notify
           command: |
             curl -d "{\"payload\":{\"username\":\"$CIRCLE_PROJECT_USERNAME\",\"reponame\":\"$CIRCLE_PROJECT_REPONAME\",\"branch\":\"$CIRCLE_BRANCH\"}}" -H 'Content-Type: application/json' -X POST https://hubot.myapp.com/hubot/deploy && touch .notified
       - run:
           name: notify-error
           when: always
           command: |
             if [ ! -f .notified ]; then curl -d "{\"payload\":{\"username\":\"$CIRCLE_PROJECT_USERNAME\",\"reponame\":\"$CIRCLE_PROJECT_REPONAME\",\"branch\":\"$CIRCLE_BRANCH\",\"failed\":\"true\",\"build_url\":\"$CIRCLE_BUILD_URL\"}}" -H 'Content-Type: application/json' -X POST https://hubot.myapp.com/hubot/deploy; fi