added image argument for private images

This commit is contained in:
Roxie Gibson 2022-01-07 23:02:43 +00:00
parent a8e77f1aee
commit 0ffe15d0e3
Signed by untrusted user: roxxers
GPG Key ID: 5D0140EDEE123F4D
2 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,10 @@ This is meant to be used as a [Drone plugin](http://plugins.drone.io/).
- **deploy_key**: SSH private key part for ssh public key authentication
- **stack**: Name of the stack to be deployed
### Required (If Private Repo)
- **image**: Name and Tag of image since private image's are not pulled automatically by docker stack deploy
### Optional (with defaults)
- **compose** (default: `compose.yml`): compose file to use for deploying

View File

@ -67,6 +67,7 @@ run_stack_deploy() {
if [[ ! -z "${PLUGIN_REG_USER}" ]] && [[ ! -z "${PLUGIN_REG_PASS}" ]]; then
echo "--- discovered secrets, assuming private registry, logging in ---"
docker login -u "${PLUGIN_REG_USER}" -p "${PLUGIN_REG_PASS}"
docker image pull "${PLUGIN_IMAGE}"
docker -H "$REMOTE_DOCKER_HOST" stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"
else
docker -H "$REMOTE_DOCKER_HOST" stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"