Add proper FAIL state logging and fix registry variable.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
7ced1e5528
commit
f8da2f4a98
14
mirror.sh
14
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}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user