diff --git a/README.md b/README.md index c1c9dfa..8973c9d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/plugin.sh b/plugin.sh index 6cfcabc..9790d39 100755 --- a/plugin.sh +++ b/plugin.sh @@ -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"