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

17 lines
258 B
Bash
Raw Normal View History

2020-09-24 11:02:01 +00:00
n=0
2020-09-24 11:05:33 +00:00
while :
2020-09-24 11:02:01 +00:00
do
docker pull $2 \
&& docker tag $2 $1$2 \
&& docker push $1$2 && break # substitute your command here
n=$((n+1))
2020-09-24 13:45:58 +00:00
if [ $n -ge 2 ]; then
2020-09-24 13:42:22 +00:00
echo "initialise failed"
exit 1
fi
2020-09-24 11:05:33 +00:00
echo "retrying..$n"
2020-09-24 12:36:23 +00:00
sleep 1
2020-09-24 11:02:01 +00:00
done