4 def RELEASES = {{RELEASES}}
5 def ARCHES = {{ARCHES}}
6 def IMAGE_TYPES = {{IMAGE_TYPES}}
7 def PROFILES = {{PROFILES}}
10 IMAGE_TYPES].combinations()
12 (params.ARCH_FILTER != 'all' && it[1] != params.ARCH_FILTER) ||
13 (params.IMAGE_TYPE_FILTER != 'all' && it[2] != params.IMAGE_TYPE_FILTER) ||
14 (params.RELEASE_FILTER != 'all' && it[0] != params.RELEASE_FILTER)
19 it[1] == 'i386' && it[2] == 'vm'
22 def base_image_tasks = [:]
23 def profile_image_tasks = [:]
24 for(int index = 0; index < c.size(); index++) {
28 IMAGE_TYPE: c[index][2]
30 def image_name = "${OS}/${envMap.RELEASE}/${envMap.ARCH}/${envMap.IMAGE_TYPE}"
31 base_image_tasks[image_name] = { ->
33 stage("base:${image_name}") {
36 job: 'images_distrobuilder',
38 string(name: 'OS', value: OS),
39 string(name: 'RELEASE', value: envMap.RELEASE),
40 string(name: 'ARCH', value: envMap.ARCH),
41 string(name: 'IMAGE_TYPE', value: envMap.IMAGE_TYPE),
42 string(name: 'GIT_URL', value: params.GIT_URL),
43 string(name: 'GIT_BRANCH', value: params.GIT_BRANCH)
48 for (int profile_index = 0; profile_index < PROFILES.size(); profile_index++) {
49 // Using a second map gets around some weirdness with the closures finding
50 // PROFILES[profile_index] where most jobs would have a null value for the
52 def envMap2 = envMap.clone()
53 envMap2.PROFILE = PROFILES[profile_index]
54 if (env.PROFILE_FILTER == 'all' || env.PROFILE_FILTER == PROFILES[profile_index]) {
55 profile_image_tasks["${PROFILES[profile_index]}:${image_name}"] = { ->
58 job: 'images_imagebuilder',
60 string(name: 'OS', value: OS),
61 string(name: 'RELEASE', value: envMap2.RELEASE),
62 string(name: 'ARCH', value: envMap2.ARCH),
63 string(name: 'IMAGE_TYPE', value: envMap2.IMAGE_TYPE),
64 string(name: 'PROFILE', value: envMap2.PROFILE),
65 string(name: 'GIT_URL', value: params.GIT_URL),
66 string(name: 'GIT_BRANCH', value: params.GIT_BRANCH)
74 if (!params.SKIP_BASE_IMAGES) {
75 stage("base images") {
76 parallel(base_image_tasks)
80 if (!params.SKIP_PROFILE_IMAGES) {
81 // While it's possible to have the tasks in "base images" start
82 // their respective profile images_imagebuilder steps, it ends
83 // up creating a pipeline overview and log that is difficult to
84 // read in the Jenkins interface.
85 stage("profile images") {
86 parallel(profile_image_tasks)