diff --git a/.drone.yml b/.drone.yml index 5d5bd90..68c6a6d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,8 +1,30 @@ kind: pipeline -name: default +name: notify-pipeline-start steps: -- name: docker +- name: slack + image: plugins/slack + settings: + webhook: + from_secret: SLACK_WEBHOOK + link_names: true + template: > + {{#if build.pull }} + *Build started*: {{ repo.owner }}/{{ repo.name }} - + {{else}} + *Build started: {{ repo.owner }}/{{ repo.name }} - Build #{{ build.number }}* (type: `{{ build.event }}`) + {{/if}} + Commit: + Branch: + Author: {{ build.author }} + <{{ build.link }}|Visit build page ↗> + +--- +kind: pipeline +name: test-docker-build + +steps: +- name: test-docker-build image: plugins/docker network_mode: bridge settings: @@ -11,7 +33,35 @@ steps: tags: - ${DRONE_COMMIT_SHA} - ${DRONE_BRANCH} -- name: send - image: plugins/webhook - settings: - urls: https://chat.sneak.cloud/hooks/5ojqjwe4stgamx8in8q3rtxnca + + +--- +kind: pipeline +name: notify-pipeline-end + +steps: + - name: slack + image: plugins/slack + settings: + webhook: + from_secret: SLACK_WEBHOOK + link_names: true + template: > + {{#if build.pull }} + *{{#success build.status}}✔{{ else }}✘{{/success}} {{ uppercasefirst build.status }}*: {{ repo.owner }}/{{ repo.name }} - + {{else}} + *{{#success build.status}}✔{{ else }}✘{{/success}} {{ uppercasefirst build.status }}: {{ repo.owner }}/{{ repo.name }} - Build #{{ build.number }}* (type: `{{ build.event }}`) + {{/if}} + Commit: + Branch: + Author: {{ build.author }} + Duration: {{ since build.created }} + <{{ build.link }}|Visit build page ↗> + +depends_on: + - test-docker-build + +trigger: + status: + - success + - failure