This commit is contained in:
parent
62c2dbf194
commit
b66d9c5314
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user