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}... "
|
echo -n "Mirroring ${image}... "
|
||||||
if ! docker pull "${image}" &> /dev/null; then
|
if ! docker pull "${image}" &> /dev/null; then
|
||||||
echo "FAIL"
|
echo "PULL FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -31,26 +31,22 @@ function mirror() {
|
|||||||
echo -n "${image_hash} received... "
|
echo -n "${image_hash} received... "
|
||||||
|
|
||||||
if ! docker tag "${image_hash}" "${DESTINATION_REGISTRY}/${image}" &> /dev/null; then
|
if ! docker tag "${image_hash}" "${DESTINATION_REGISTRY}/${image}" &> /dev/null; then
|
||||||
echo "FAIL"
|
echo "TAGGING FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "pushing... "
|
echo -n "pushing... "
|
||||||
if ! docker push "${REGISTRY_TO_MIRROR}/${image}" &> /dev/null; then
|
if ! docker push "${DESTINATION_REGISTRY}/${image}" &> /dev/null; then
|
||||||
echo "FAIL"
|
echo "FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "OK"
|
echo "OK"
|
||||||
|
|
||||||
docker image rm "${image}" &> /dev/null
|
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.
|
# Login to registry.
|
||||||
docker login -u "${USER}" -p "${PASSWORD}" "${DESTINATION_REGISTRY}"
|
docker login -u "${USER}" -p "${PASSWORD}" "${DESTINATION_REGISTRY}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user