Remove output redirection to /dev/null for debugging purposes.
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
f8da2f4a98
commit
12c0d3771d
11
mirror.sh
11
mirror.sh
@ -22,7 +22,7 @@ function mirror() {
|
|||||||
image_version=$(echo "${image}" | cut -d":" -f 2)
|
image_version=$(echo "${image}" | cut -d":" -f 2)
|
||||||
|
|
||||||
echo -n "Mirroring ${image}... "
|
echo -n "Mirroring ${image}... "
|
||||||
if ! docker pull "${image}" &> /dev/null; then
|
if ! docker pull "${image}"; then
|
||||||
echo "PULL FAILED"
|
echo "PULL FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -30,24 +30,25 @@ function mirror() {
|
|||||||
image_hash=$(docker images -a | grep "^${image_name}" | grep "${image_version}" | awk "{' print $3 '}")
|
image_hash=$(docker images -a | grep "^${image_name}" | grep "${image_version}" | awk "{' print $3 '}")
|
||||||
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}"; then
|
||||||
echo "TAGGING FAILED"
|
echo "TAGGING FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "pushing... "
|
echo -n "pushing... "
|
||||||
if ! docker push "${DESTINATION_REGISTRY}/${image}" &> /dev/null; then
|
if ! docker push "${DESTINATION_REGISTRY}/${image}"; then
|
||||||
echo "FAILED"
|
echo "FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "OK"
|
echo "OK"
|
||||||
|
|
||||||
docker image rm "${image}" &> /dev/null
|
docker image rm "${image}"
|
||||||
docker image rm "${DESTINATION_REGISTRY}/${image}" &> /dev/null
|
docker image rm "${DESTINATION_REGISTRY}/${image}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Login to registry.
|
# Login to registry.
|
||||||
|
echo "Logging into '${DESTINATION_REGISTRY}' as '${USER}'..."
|
||||||
docker login -u "${USER}" -p "${PASSWORD}" "${DESTINATION_REGISTRY}"
|
docker login -u "${USER}" -p "${PASSWORD}" "${DESTINATION_REGISTRY}"
|
||||||
|
|
||||||
# Mirror images.
|
# Mirror images.
|
||||||
|
Loading…
Reference in New Issue
Block a user