File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
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 4545
4646COMPOSE_FILE=${INPUT_COMPOSE_FILE_PATH}
4747DOCKER_HOST=ssh://${INPUT_REMOTE_DOCKER_HOST} :${INPUT_SSH_PORT}
48- DEPLOYMENT_COMMAND=" docker compose -f $COMPOSE_FILE "
49-
5048
5149SSH_HOST=${INPUT_REMOTE_DOCKER_HOST#*@ }
5250
@@ -94,10 +92,16 @@ if [ -n "$INPUT_DOCKER_LOGIN_PASSWORD" ] || [ -n "$INPUT_DOCKER_LOGIN_USER" ] |
9492 docker login -u " $INPUT_DOCKER_LOGIN_USER " -p " $INPUT_DOCKER_LOGIN_PASSWORD " " $INPUT_DOCKER_LOGIN_REGISTRY "
9593fi
9694
97- echo " Command: docker compose -f $COMPOSE_FILE pull"
98- docker compose -f $COMPOSE_FILE pull
99-
100- echo " Command: docker compose -f $COMPOSE_FILE ${INPUT_ARGS} "
101- docker compose -f $COMPOSE_FILE ${INPUT_ARGS}
95+ if $INPUT_DOCKER_SWARM
96+ then
97+ echo " docker swarm mode enabled, using docker stack command"
98+ echo " Command: docker ${INPUT_ARGS} stack deploy --compose-file ${COMPOSE_FILE} "
99+ docker ${INPUT_ARGS} stack deploy --compose-file ${COMPOSE_FILE}
100+ else
101+ echo " Command: docker compose -f ${COMPOSE_FILE} pull"
102+ docker compose -f ${COMPOSE_FILE} pull
102103
104+ echo " Command: docker compose -f ${COMPOSE_FILE} ${INPUT_ARGS} "
105+ docker compose -f ${COMPOSE_FILE} ${INPUT_ARGS}
106+ fi
103107
You can’t perform that action at this time.
0 commit comments