Skip to content

Commit

Permalink
Merge pull request #229 from CircleCI-Public/slack
Browse files Browse the repository at this point in the history
Add slack notifications
  • Loading branch information
Zachary Scott authored Dec 29, 2018
2 parents 4dd063b + b60b70f commit 99c297c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: 2.1
orbs:
codecov: circleci/[email protected]
shellcheck: circleci/[email protected]
slack: circleci/[email protected]

executors:
go:
Expand All @@ -22,6 +23,11 @@ commands:
- save_cache:
key: v1-gomod-{{ checksum "go.sum" }}
paths: [/go/pkg/mod]
# Wrap the slack/status command to only notify on failures
slack-notify-on-failure:
steps:
- slack/status:
fail_only: "true"

jobs:
test:
Expand All @@ -30,6 +36,7 @@ jobs:
- checkout
- gomod
- run: make test
- slack-notify-on-failure

coverage:
executor: go
Expand All @@ -44,6 +51,7 @@ jobs:
destination: coverage.txt
- codecov/upload:
path: coverage.txt
- slack-notify-on-failure

docs:
executor: go
Expand All @@ -57,22 +65,25 @@ jobs:
destination: docs
- run: ./.circleci/generate-docs.sh
- run: ./.circleci/deploy-gh-pages.sh
- slack-notify-on-failure

lint:
docker:
- image: supinf/gometalinter:latest
environment:
CGO_ENABLED: 0
SHELL: /bin/bash
working_directory: /go/src/github.com/CircleCI-Public/circleci-cli
steps:
- checkout
- run:
name: Install deps to use with gometalinter
command: |
apk --no-cache add --virtual git
apk --no-cache add git bash curl
go get -u github.com/golang/dep/cmd/dep
dep init
- run: gometalinter ./...
- slack-notify-on-failure

deploy:
executor: go
Expand Down Expand Up @@ -128,6 +139,7 @@ jobs:
- store_artifacts:
path: ./dist
destination: dist
- slack-notify-on-failure

snap:
docker:
Expand All @@ -146,6 +158,7 @@ jobs:
mkdir .snapcraft
echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg
snapcraft push *.snap --release stable
- slack-notify-on-failure

brew-deploy:
macos:
Expand All @@ -164,6 +177,7 @@ jobs:
git config --global user.name "$GH_NAME" > /dev/null 2>&1
- run: brew --version
- run: ./.circleci/brew-deploy.sh
- slack-notify-on-failure

workflows:
version: 2
Expand Down

0 comments on commit 99c297c

Please sign in to comment.