diff --git a/mirror.sh b/mirror.sh index 077a7d4..8216848 100755 --- a/mirror.sh +++ b/mirror.sh @@ -23,7 +23,7 @@ function mirror() { echo -n "Mirroring ${image}... " if ! docker pull "${image}" &> /dev/null; then - echo "FAIL" + echo "PULL FAILED" exit 1 fi @@ -31,26 +31,22 @@ function mirror() { echo -n "${image_hash} received... " if ! docker tag "${image_hash}" "${DESTINATION_REGISTRY}/${image}" &> /dev/null; then - echo "FAIL" + echo "TAGGING FAILED" exit 1 fi echo -n "pushing... " - if ! docker push "${REGISTRY_TO_MIRROR}/${image}" &> /dev/null; then - echo "FAIL" + if ! docker push "${DESTINATION_REGISTRY}/${image}" &> /dev/null; then + echo "FAILED" exit 1 fi echo "OK" docker image rm "${image}" &> /dev/null - docker image rm "${REGISTRY_TO_MIRROR}/${image}" &> /dev/null + docker image rm "${DESTINATION_REGISTRY}/${image}" &> /dev/null } -env -# shellcheck disable=SC2154 -echo "Secret test: ${drone_secret} or ${PASSWORD}" - # Login to registry. docker login -u "${USER}" -p "${PASSWORD}" "${DESTINATION_REGISTRY}"