From b66d9c5314f68558fda03c86e0fc38d9205d2961 Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Mon, 27 Jun 2022 00:10:08 +0500 Subject: [PATCH] Debug commit. --- .drone.yml | 3 ++- mirror.sh | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index dc2fc1d..b24ad86 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,8 +26,9 @@ steps: image: "docker:20.10.17-dind" pull: if-not-exists environment: + REGISTRY_USER: drone REGISTRY_SECRET: from_secret: drone_secret commands: - apk add --no-cache bash - - ./mirror.sh drone ${REGISTRY_SECRET} + - ./mirror.sh diff --git a/mirror.sh b/mirror.sh index 53ee580..077a7d4 100755 --- a/mirror.sh +++ b/mirror.sh @@ -4,8 +4,8 @@ WHAT_TO_MIRROR=() DESTINATION_REGISTRY=code.pztrn.name/containers/mirror -REGISTRY_USER=$1 -REGISTRY_PASSWORD=$2 +USER=${REGISTRY_USER} +PASSWORD=${REGISTRY_PASSWORD} MIRROR_CONFIGS=$(ls ./images/*.sh) for file in "${MIRROR_CONFIGS[@]}"; do @@ -49,10 +49,10 @@ function mirror() { env # shellcheck disable=SC2154 -echo "Secret test: ${drone_secret} or ${REGISTRY_PASSWORD}" +echo "Secret test: ${drone_secret} or ${PASSWORD}" # Login to registry. -docker login -u "${REGISTRY_USER}" -p "${REGISTRY_PASSWORD}" "${DESTINATION_REGISTRY}" +docker login -u "${USER}" -p "${PASSWORD}" "${DESTINATION_REGISTRY}" # Mirror images. for image in "${WHAT_TO_MIRROR[@]}"; do