attempt to support private registries
This commit is contained in:
parent
3fb617a797
commit
3fde5ef21a
|
@ -21,6 +21,8 @@ This is meant to be used as a [Drone plugin](http://plugins.drone.io/).
|
||||||
- **user** (default: `drone`): System user to connect via SSH with
|
- **user** (default: `drone`): System user to connect via SSH with
|
||||||
- **networks** (default:): Try and auto-create these networks first
|
- **networks** (default:): Try and auto-create these networks first
|
||||||
- **rm**: (default: `false`): Remove the stack before deploying it
|
- **rm**: (default: `false`): Remove the stack before deploying it
|
||||||
|
- **reg_user**: Registry user if publishing from a private repository
|
||||||
|
- **reg_pass**: Registry password if publishing from a private repository
|
||||||
|
|
||||||
### Dangerous options, unwise outside CI
|
### Dangerous options, unwise outside CI
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,14 @@ output_versions(){
|
||||||
|
|
||||||
run_stack_deploy() {
|
run_stack_deploy() {
|
||||||
echo "--- start deploy ---"
|
echo "--- start deploy ---"
|
||||||
docker -H "$REMOTE_DOCKER_HOST" stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"
|
|
||||||
|
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 -H "$REMOTE_DOCKER_HOST" stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"
|
||||||
|
else
|
||||||
|
docker -H "$REMOTE_DOCKER_HOST" stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"
|
||||||
|
fi
|
||||||
echo "--- end deploy ---"
|
echo "--- end deploy ---"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue