11def images = []
2- def image_versions = [:]
2+ def image_version = [:]
33def removable_tags = []
44
55pipeline {
@@ -48,9 +48,15 @@ pipeline {
4848 script {
4949 manifest = readFile(" ${ env.IMAGE_DIR_BASE} /manifest.json" )
5050 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+ }
5460 env. BUILD_OPTS = " --pull"
5561 env. LOG_LEVEL = params. logLevel
5662 }
@@ -66,7 +72,7 @@ pipeline {
6672 stage(" Create image on Scaleway" ) {
6773 steps {
6874 script {
69- for (String arch in image_versions[env . IMAGE_VERSION ] [' architectures' ]) {
75+ for (String arch in image_version [' architectures' ]) {
7076 echo " Creating image for $arch "
7177 sh " make ARCH=$arch IMAGE_DIR=${ env.IMAGE_DIR} EXPORT_DIR=${ env.EXPORT_DIR_BASE} /$arch BUILD_OPTS='${ env.BUILD_OPTS} ' scaleway_image"
7278 script {
@@ -127,7 +133,7 @@ pipeline {
127133 message = groovy.json.JsonOutput . toJson([
128134 type : " image" ,
129135 data : [
130- marketplace_id : image_versions[env . IMAGE_VERSION ] [' marketplace-id' ],
136+ marketplace_id : image_version [' marketplace-id' ],
131137 versions : images
132138 ]
133139 ])
0 commit comments