portainer/.drone/scripts/initialise-image.sh

16 lines
261 B
Bash
Raw Permalink Normal View History

2020-10-22 16:02:43 +00:00
n=0
while :
do
docker pull $2 \
2020-10-22 16:06:15 +00:00
&& docker tag $2 $1$3 \
&& docker push $1$3 && break # substitute your command here
2020-10-22 16:02:43 +00:00
n=$((n+1))
if [ $n -ge 10 ]; then
echo "initialise failed"
exit 1
fi
echo "retrying..$n"
sleep 5
done