stack-ssh-deploy/plugin.sh
Luke Murphy 9655b55dd7
All checks were successful
continuous-integration/drone/push Build is passing
Add maybe a working implementation
2020-09-23 09:00:55 +02:00

27 lines
411 B
Bash
Executable File

#!/bin/sh
load_deploy_key() {
eval `ssh-agent`
echo "$PLUGIN_DEPLOY_KEY" | ssh-add -
}
run_stack_deploy() {
PLUGIN_COMPOSE=${PLUGIN_COMPOSE:-compose.yml}
docker stack deploy \
-c "$PLUGIN_COMPOSE" \
-H "$PLUGIN_HOST" \
"$PLUGIN_STACK"
}
run_plugin() {
echo "--- Starting deployment ---"
load_deploy_key
run_stack_deploy
echo "--- Deployment successful ---"
}
run_plugin
exit 0