forked from edseymour/ose-auto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpre-load.sh
executable file
·70 lines (55 loc) · 1.47 KB
/
pre-load.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
#!/bin/bash
. functions.sh
for node in $hosts
do
fqdn=$(gen_fqdn $node)
scmd $ssh_user@$fqdn <<-\SSH
IMAGES=(
jboss-webserver-3/tomcat7-openshift
jboss-webserver-3/tomcat8-openshift
jboss-eap-6/eap-openshift
jboss-amq-6/amq-openshift
openshift3/jenkins-1-rhel7
openshift3/mongodb-24-rhel7
openshift3/mysql-55-rhel7
openshift3/nodejs-010-rhel7
openshift3/ose-deployer
openshift3/ose-docker-builder
openshift3/ose-docker-registry
openshift3/ose-f5-router
openshift3/ose-haproxy-router
openshift3/ose-keepalived-ipfailover
openshift3/ose-pod
openshift3/ose-sti-builder
openshift3/perl-516-rhel7
openshift3/php-55-rhel7
openshift3/postgresql-92-rhel7
openshift3/python-33-rhel7
openshift3/ruby-20-rhel7
)
for image in "${IMAGES[@]}"; do
tags=$(curl -s https://registry.access.redhat.com/v1/repositories/$image/tags | python -c "import json
import random
import string
import sys
def key_val(pairs, key):
for k in pairs:
if k["Key"] == key:
return k["Value"]
return None
j = json.loads(sys.stdin.read())
for r in j:
print r
")
for tag in $tags; do
if [[ "$tag" == *"-"* ]] || [[ "$tag" == "latest" ]]; then
echo "skipping $image:$tag"
else
echo "prefetching $image:$tag"
sudo docker pull registry.access.redhat.com/$image:$tag
fi
done
done
exit
SSH
done