blob: 7df6bc5f4e0b6a3dbe721554142fc6b8b09a1f1a [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 """
31 kind load docker-image ${image}:citest --name ${cfg.name} --nodes ${cfg.name}-worker,${cfg.name}-worker2
32 """
33 }
34}