add docker login repo
parent
923f9b7f3f
commit
a8b892ebd0
|
@ -11,11 +11,11 @@ steps:
|
||||||
- name: docker push
|
- name: docker push
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
username:
|
registry: git.local-it.org
|
||||||
from_secret: docker_reg_username_coopcloud
|
repo: git.local-it.org/philipp/stack-ssh-deply
|
||||||
|
username: philipp
|
||||||
password:
|
password:
|
||||||
from_secret: docker_reg_passwd_coopcloud
|
from_secret: docker_registry
|
||||||
repo: thecoopcloud/stack-ssh-deploy
|
|
||||||
tags: latest
|
tags: latest
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
# stack-ssh-deploy
|
# stack-ssh-deploy
|
||||||
|
|
||||||
[![Build Status](https://drone.autonomic.zone/api/badges/coop-cloud/stack-ssh-deploy/status.svg?ref=refs/heads/main)](https://drone.autonomic.zone/coop-cloud/stack-ssh-deploy)
|
|
||||||
|
|
||||||
Deploy swarm stacks against a SSH based remote docker daemon context.
|
Deploy swarm stacks against a SSH based remote docker daemon context.
|
||||||
|
|
||||||
This is meant to be used as a [Drone plugin](http://plugins.drone.io/).
|
This is meant to be used as a [Drone plugin](http://plugins.drone.io/).
|
||||||
|
@ -27,6 +25,7 @@ This is meant to be used as a [Drone plugin](http://plugins.drone.io/).
|
||||||
- **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_user**: Registry user if publishing from a private repository
|
||||||
- **reg_pass**: Registry password if publishing from a private repository
|
- **reg_pass**: Registry password if publishing from a private repository
|
||||||
|
- **reg_url**: Registry URL
|
||||||
|
|
||||||
### Dangerous options, unwise outside CI
|
### Dangerous options, unwise outside CI
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ PLUGIN_PORT=${PLUGIN_PORT:-222}
|
||||||
PLUGIN_PURGE=${PLUGIN_PURGE:-"false"}
|
PLUGIN_PURGE=${PLUGIN_PURGE:-"false"}
|
||||||
PLUGIN_USER=${PLUGIN_USER:-drone}
|
PLUGIN_USER=${PLUGIN_USER:-drone}
|
||||||
PLUGIN_RM=${PLUGIN_RM:-"false"}
|
PLUGIN_RM=${PLUGIN_RM:-"false"}
|
||||||
|
PLUGIN_REG_URL=${PLUGIN_REG_URL:-""}
|
||||||
|
|
||||||
REMOTE_DOCKER_HOST="ssh://$PLUGIN_USER@$PLUGIN_HOST:$PLUGIN_PORT"
|
REMOTE_DOCKER_HOST="ssh://$PLUGIN_USER@$PLUGIN_HOST:$PLUGIN_PORT"
|
||||||
|
|
||||||
|
@ -66,7 +67,7 @@ run_stack_deploy() {
|
||||||
|
|
||||||
if [[ ! -z "${PLUGIN_REG_USER}" ]] && [[ ! -z "${PLUGIN_REG_PASS}" ]]; then
|
if [[ ! -z "${PLUGIN_REG_USER}" ]] && [[ ! -z "${PLUGIN_REG_PASS}" ]]; then
|
||||||
echo "--- discovered secrets, assuming private registry, logging in ---"
|
echo "--- discovered secrets, assuming private registry, logging in ---"
|
||||||
docker -H "$REMOTE_DOCKER_HOST" login -u "${PLUGIN_REG_USER}" -p "${PLUGIN_REG_PASS}"
|
docker -H "$REMOTE_DOCKER_HOST" login "${PLUGIN_REG_URL}" -u "${PLUGIN_REG_USER}" -p "${PLUGIN_REG_PASS}"
|
||||||
docker -H "$REMOTE_DOCKER_HOST" pull "${PLUGIN_IMAGE}"
|
docker -H "$REMOTE_DOCKER_HOST" pull "${PLUGIN_IMAGE}"
|
||||||
echo "${PLUGIN_IMAGE}"
|
echo "${PLUGIN_IMAGE}"
|
||||||
docker -H "$REMOTE_DOCKER_HOST" stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"
|
docker -H "$REMOTE_DOCKER_HOST" stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"
|
||||||
|
|
Loading…
Reference in New Issue