From 73a64b6ea14c75adfa3b4028ff7795af3720a775 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Tue, 7 Jun 2022 14:59:39 +0300 Subject: [PATCH] add org_registry env by default --- .drone.yml | 3 +-- entrypoint.sh | 6 +++++- readme.md | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8e072f5..09908d7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,6 +16,5 @@ steps: from_secret: org_registry_username password: from_secret: org_registry_password - registry: registry.pleshevski.ru - repo: registry.pleshevski.ru/${DRONE_REPO} + repo: ${ORG_REGISTRY}/${DRONE_REPO} diff --git a/entrypoint.sh b/entrypoint.sh index 549505b..9375b14 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,7 +3,11 @@ set -ex if [ -n "$PLUGIN_PASSWORD" ]; then - echo -n "$PLUGIN_PASSWORD" | docker login -u "$PLUGIN_USERNAME" --password-stdin $PLUGIN_REGISTRY + echo -n "$PLUGIN_PASSWORD" | \ + docker login \ + -u "$PLUGIN_USERNAME" \ + --password-stdin \ + ${PLUGIN_REGISTRY:-$ORG_REGISTRY} AUTH_FLAGS=--with-registry-auth fi diff --git a/readme.md b/readme.md index d0866de..61e8cce 100644 --- a/readme.md +++ b/readme.md @@ -8,6 +8,6 @@ Simple bash plugin to login and stack deploy | ----------------- | ------ | ------------------ | ----------------------------------------- | | name | string | $DRONE_REPO_NAME | Stack name | | compose_file_path | string | docker-compose.yml | Path to your docker compose configuration | -| registry | string | | Authenticates to this registry | +| registry | string | $ORG_REGISTRY | Authenticates to this registry | | username | string | | Authenticates with this username | | password | string | | Authenticates with this password |