1
1
def images = []
2
- def image_versions = [:]
2
+ def image_version = [:]
3
3
def removable_tags = []
4
4
5
5
pipeline {
@@ -48,9 +48,15 @@ pipeline {
48
48
script {
49
49
manifest = readFile(" ${ env.IMAGE_DIR_BASE} /manifest.json" )
50
50
manifest_data = new groovy.json.JsonSlurperClassic (). parseText(manifest)
51
- image_versions = manifest_data[' images' ]
52
- env. IMAGE_DIR = env. IMAGE_DIR_BASE + ' /' + image_versions[env. IMAGE_VERSION ][' directory' ]
53
- env. MARKETPLACE_IMAGE_NAME = image_versions[env. IMAGE_VERSION ][' marketplace-name' ]
51
+ image_version = manifest_data[' images' ][env. IMAGE_VERSION ]
52
+ env. IMAGE_DIR = env. IMAGE_DIR_BASE + ' /' + image_version[' directory' ]
53
+ env. MARKETPLACE_IMAGE_NAME = image_version[' marketplace-name' ]
54
+ env. IMAGE_DISK_SIZE = " 50G"
55
+ if (image_version. containsKey(' options' )) {
56
+ if (image_version[' options' ]. containsKey(' disk-size' )) {
57
+ env. IMAGE_DISK_SIZE = image_version[' options' ][' disk-size' ]
58
+ }
59
+ }
54
60
env. BUILD_OPTS = " --pull"
55
61
env. LOG_LEVEL = params. logLevel
56
62
}
@@ -66,7 +72,7 @@ pipeline {
66
72
stage(" Create image on Scaleway" ) {
67
73
steps {
68
74
script {
69
- for (String arch in image_versions[env . IMAGE_VERSION ] [' architectures' ]) {
75
+ for (String arch in image_version [' architectures' ]) {
70
76
echo " Creating image for $arch "
71
77
sh " make ARCH=$arch IMAGE_DIR=${ env.IMAGE_DIR} EXPORT_DIR=${ env.EXPORT_DIR_BASE} /$arch BUILD_OPTS='${ env.BUILD_OPTS} ' scaleway_image"
72
78
script {
@@ -127,7 +133,7 @@ pipeline {
127
133
message = groovy.json.JsonOutput . toJson([
128
134
type : " image" ,
129
135
data : [
130
- marketplace_id : image_versions[env . IMAGE_VERSION ] [' marketplace-id' ],
136
+ marketplace_id : image_version [' marketplace-id' ],
131
137
versions : images
132
138
]
133
139
])
0 commit comments