blob: 520aee23e826847ea71c25c074ee576677e462c9 [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++) {
22 def image = list[i]
23 println "Loading image ${image} on Kind cluster ${cfg.name}"
24
25 sh """
26 kind load docker-image ${image}:citest --name ${cfg.name} --nodes ${cfg.name}-worker,${cfg.name}-worker2
27 """
28 }
29}