Search code examples
sshpush-notificationcommandremote-server

Trigger notification over SSH pipeline


I have a question about SSH and notifications (or commands in general).

I have: 1. my computer which is a macbook pro 2. my server which is a Debian 9

On my server I have: 1. Nodejs (npm, node, etc...) 2. My web projects using node for build

What I want to do: 1. Display a notification on my screen (my macbook pro) when a build is finished on my server

Is their any possibility to execute some commands on my macbook from the server directly? I'm connected over SSH so invoking commands on my server from my macbook pro is easy, but the reverse...?

Hope this is clear and that someone has an idea to help me..


Solution

    1. Create a ssh tunnel from your mac to your server. ssh -R 19999:localhost:22 sourceuser@123.45.67.89
    2. When the build is finished, execute ssh localhost -p 19999 notify.sh
    3. Implement the notification part in notify.sh.