drone-plugins / drone-slack

Drone plugin for sending Slack notifications
http://plugins.drone.io/drone-plugins/drone-slack
Apache License 2.0
61 stars 80 forks source link

How do I use slack plugin within ssh pipeline #99

Closed tintinthong closed 5 years ago

tintinthong commented 5 years ago

Roughly code structure.

kind: pipeline
type: ssh
name: default

server: 
    host: XXXX
    user: root
    ssh_key: 
        from_secret: ssh_key

steps: 
- name XXXX
...
...
...
- name: slack
  image: plugins/slack
  settings:
    webhook: XXXXXXXX
    channel: cicd
    template: > 
      {{#success build.status}} 
        *{{#success build.status}}✔{{ else }}✘{{/success}} {{ uppercasefirst build.status }}*: <https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ build.pull }}|Pull Request #{{ build.pull }}>
      {{else}}
        *{{#success build.status}}✔{{ else }}✘{{/success}} {{ uppercasefirst build.status }}: Build #{{ build.number }}* (type: `{{ build.event }}`)
      <{{ build.link }}|Visit build page ↗>
      {{/success}}
      Commit: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commit/{{ build.commit }}|{{ truncate build.commit 8 }}> 

      Branch: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}> 

      Author: {{ build.author }} 
  when:
    status:
      - success
      - failure
tboerger commented 5 years ago

That's an expected behavior. The SSH runner is not using Docker at all. If you want to get notifications by this plugin you got to put it into a separate Docker pipeline and depend on your SSH pipeline.

For support please use one of our support channels, such as our chatroom or our mailing list.