Add proper FAIL state logging and fix registry variable.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Stanislav Nikitin 2022-06-27 00:12:17 +05:00
parent 7ced1e5528
commit f8da2f4a98
Signed by: pztrn
GPG Key ID: 1E944A0F0568B550

View File

@ -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}"