blob: 379b9f3297b1c4af686598170ba1f1e2521fe066 [file] [log] [blame]
Matteo Scandolo42f6e572021-01-25 15:11:34 -08001// loads all the images tagged as citest on a Kind cluster
2
3def call(Map config) {
4 def defaultConfig = [
5 name: "kind-ci"
6 ]
7
8 if (!config) {
9 config = [:]
10 }
11
12 def cfg = defaultConfig + config
13
14 def images = sh (
15 script: 'docker images -f "reference=**/*citest" --format "{{.Repository}}"',
16 returnStdout: true
17 ).trim()
18
19 def list = images.split("\n")
20
21 for(int i = 0;i<list.size();i++) {
Matteo Scandolobd176d72021-02-03 10:55:25 -080022 def image = list[i].trim()
23
24 if (!image) {
25 return
26 }
27
Matteo Scandolo42f6e572021-01-25 15:11:34 -080028 println "Loading image ${image} on Kind cluster ${cfg.name}"
29
30 sh """
Matteo Scandolo2411a3c2021-03-15 16:00:20 -070031 kind load docker-image ${image}:citest --name ${cfg.name} --nodes ${cfg.name}-control-plane,${cfg.name}-worker,${cfg.name}-worker2
Matteo Scandolo42f6e572021-01-25 15:11:34 -080032 """
33 }
34}