-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeMe.sh
74 lines (59 loc) · 1.27 KB
/
makeMe.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
#editor: cpt_redbeard
#Task: build a ton of images to test with, delete them, retag them, push them
#modifiable values
images="10000"
repo="imagerepo"
image="alpine-mass"
registry="NewRegistryName"
newrepo="NewRepoName"
newimage="NewImageName"
#constant
count="605"
echo "Make, Tag, Push or Destroy?"
echo "Push only pushes from the newtag"
read decision
case $decision in
[Dd] | [Dd][Ee][Ss][Tt][Rr][Oo][Yy] )
echo "Destroying..."
while [ ${images} -gt ${count} ];
do
docker rmi $repo/$image:$count
sleep 2
count=$[$count+1]
done
;;
[Tt] | [Tt][Aa][Gg] )
echo "Tagging..."
while [ ${images} -gt ${count} ];
do
#docker rmi $repo/$image:$count
docker tag $repo/$image:$count $registry/$newrepo/$newimage:$count
sleep 2
count=$[$count+1]
done
;;
[Pp] | [Pp][Uu][Ss][Hh] )
echo "Pushing..."
while [ ${images} -gt ${count} ];
do
#docker rmi $repo/$image:$count
docker push $registry/$newrepo/$newimage:$count
sleep 2
count=$[$count+1]
done
;;
[Mm] | [Mm][Aa][Kk][Ee] )
echo "Making..."
while [ ${images} -gt ${count} ];
do
#docker rmi $repo/$image:$count
docker build -t $repo/$image:$count .
sleep 2
count=$[$count+1]
done
;;
*)
echo "Unkown choice, please select one of the above"
;;
esac