add docker login repo

main
Philipp Rothmann 2023-01-12 14:38:56 +01:00
parent 923f9b7f3f
commit a8b892ebd0
3 changed files with 7 additions and 7 deletions

View File

@ -11,11 +11,11 @@ steps:
- name: docker push
image: plugins/docker
settings:
username:
from_secret: docker_reg_username_coopcloud
registry: git.local-it.org
repo: git.local-it.org/philipp/stack-ssh-deply
username: philipp
password:
from_secret: docker_reg_passwd_coopcloud
repo: thecoopcloud/stack-ssh-deploy
from_secret: docker_registry
tags: latest
trigger:
branch:

View File

@ -1,7 +1,5 @@
# 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.
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
- **reg_user**: Registry user 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

View File

@ -8,6 +8,7 @@ PLUGIN_PORT=${PLUGIN_PORT:-222}
PLUGIN_PURGE=${PLUGIN_PURGE:-"false"}
PLUGIN_USER=${PLUGIN_USER:-drone}
PLUGIN_RM=${PLUGIN_RM:-"false"}
PLUGIN_REG_URL=${PLUGIN_REG_URL:-""}
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
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}"
echo "${PLUGIN_IMAGE}"
docker -H "$REMOTE_DOCKER_HOST" stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"