Execute shell scripts on remote machines

Sometimes you need to run scripts on remote machines triggered by webhooks from Github, DockerHub or just Slack command.

Starting the agent

First, install the CLI following the installation instructions.

Then, start forwarding webhooks with --relayer exec option:

relay forward --bucket my-bucket-name --relayer exec --command bash update.sh

Where update.sh contents:

#!/bin/bash
git pull
docker-compose up -d

This would pull latest manifest of your docker-compose.yml and restart containers with new versions. This file can be anything. You can put any logic inside the script.

If you would like to execute python script, you can do it like this:

relay forward --bucket my-bucket-name --relayer exec --command python3 update.py