File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ inputs:
3030 docker_login_password :
3131 description : The docker login password
3232 required : false
33+ docker_swarm :
34+ description : enables docker swarm mode (docker stack deploy), defaults to false
35+ default : ' false'
3336 docker_login_user :
3437 description : The docker login user
3538 required : false
Original file line number Diff line number Diff line change @@ -43,10 +43,7 @@ if [ -z "$INPUT_SSH_PORT" ]; then
4343 INPUT_SSH_PORT=22
4444fi
4545
46- COMPOSE_FILE=${INPUT_COMPOSE_FILE_PATH}
4746DOCKER_HOST=ssh://${INPUT_REMOTE_DOCKER_HOST} :${INPUT_SSH_PORT}
48- DEPLOYMENT_COMMAND=" docker compose -f $COMPOSE_FILE "
49-
5047
5148SSH_HOST=${INPUT_REMOTE_DOCKER_HOST#*@ }
5249
@@ -94,10 +91,16 @@ if [ -n "$INPUT_DOCKER_LOGIN_PASSWORD" ] || [ -n "$INPUT_DOCKER_LOGIN_USER" ] |
9491 docker login -u " $INPUT_DOCKER_LOGIN_USER " -p " $INPUT_DOCKER_LOGIN_PASSWORD " " $INPUT_DOCKER_LOGIN_REGISTRY "
9592fi
9693
97- echo " Command: ${DEPLOYMENT_COMMAND} pull"
98- ${DEPLOYMENT_COMMAND} pull
99-
100- echo " Command: ${DEPLOYMENT_COMMAND} ${INPUT_ARGS} "
101- ${DEPLOYMENT_COMMAND} ${INPUT_ARGS}
94+ if $INPUT_DOCKER_SWARM
95+ then
96+ echo " docker swarm mode enabled, using docker stack command"
97+ echo " Command: docker ${INPUT_ARGS} stack deploy --compose-file ${INPUT_COMPOSE_FILE_PATH} "
98+ docker ${INPUT_ARGS} stack deploy --compose-file ${INPUT_COMPOSE_FILE_PATH}
99+ else
100+ echo " Command: docker compose -f ${INPUT_COMPOSE_FILE_PATH} pull"
101+ docker compose -f ${INPUT_COMPOSE_FILE_PATH} pull
102102
103+ echo " Command: docker compose -f ${INPUT_COMPOSE_FILE_PATH} ${INPUT_ARGS} "
104+ docker compose -f ${INPUT_COMPOSE_FILE_PATH} ${INPUT_ARGS}
105+ fi
103106
You can’t perform that action at this time.
0 commit comments