Re-work DOCKER_HOST usage
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
f55ecf5d45
commit
7631f09aa6
|
@ -8,7 +8,7 @@ PLUGIN_PORT=${PLUGIN_PORT:-222}
|
||||||
PLUGIN_PURGE=${PLUGIN_PURGE:-"false"}
|
PLUGIN_PURGE=${PLUGIN_PURGE:-"false"}
|
||||||
PLUGIN_USER=${PLUGIN_USER:-drone}
|
PLUGIN_USER=${PLUGIN_USER:-drone}
|
||||||
|
|
||||||
export DOCKER_HOST="ssh://$PLUGIN_USER@$PLUGIN_HOST:$PLUGIN_PORT"
|
DOCKER_HOST="ssh://$PLUGIN_USER@$PLUGIN_HOST:$PLUGIN_PORT"
|
||||||
|
|
||||||
generate_secrets() {
|
generate_secrets() {
|
||||||
echo "--- start secrets ---"
|
echo "--- start secrets ---"
|
||||||
|
@ -44,11 +44,13 @@ output_versions(){
|
||||||
|
|
||||||
run_stack_deploy() {
|
run_stack_deploy() {
|
||||||
echo "--- start deploy ---"
|
echo "--- start deploy ---"
|
||||||
docker stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"
|
docker -H "$DOCKER_HOST" stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"
|
||||||
echo "--- end deploy ---"
|
echo "--- end deploy ---"
|
||||||
}
|
}
|
||||||
|
|
||||||
run_stack_wait() {
|
run_stack_wait() {
|
||||||
|
export DOCKER_HOST="ssh://$PLUGIN_USER@$PLUGIN_HOST:$PLUGIN_PORT"
|
||||||
|
|
||||||
docker run --rm vitalets/docker-stack-wait-deploy \
|
docker run --rm vitalets/docker-stack-wait-deploy \
|
||||||
| sed 's/True/true/' \
|
| sed 's/True/true/' \
|
||||||
| bash /dev/stdin "$PLUGIN_STACK"
|
| bash /dev/stdin "$PLUGIN_STACK"
|
||||||
|
@ -56,7 +58,7 @@ run_stack_wait() {
|
||||||
|
|
||||||
run_purge() {
|
run_purge() {
|
||||||
echo "--- start purge ---"
|
echo "--- start purge ---"
|
||||||
docker prune --all --volumes --force
|
docker -H "$DOCKER_HOST" prune --all --volumes --force
|
||||||
echo "--- end purge ---"
|
echo "--- end purge ---"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue