@@ -69,10 +69,12 @@ def run(command, cwd=None, input=None):
69
69
@click .option ('-p' , '--push' , is_flag = True , help = 'Push only, do not build.' )
70
70
@click .option ('-r' , '--rebuild' , is_flag = True , help = 'Ignore docker image caches (i.e. rebuild).' )
71
71
@click .option ('-a' , '--all' , is_flag = True , help = 'Build and/or push all images in manifest.' )
72
+ @click .option ('-E' , '--experimental' , is_flag = True , help = 'Enable experimental versions.' )
72
73
@click .option ('-v' , '--verbose' , is_flag = True , help = 'Be verbose.' )
73
74
@click .option ('--boring' , is_flag = True , help = 'Be boring -- no progress bar.' )
74
75
@click .argument ('imagenames' , type = str , nargs = - 1 )
75
- def build_cargo (manifest : str , do_list = False , build = False , push = False , all = False , rebuild = False , boring = False , verbose = False , imagenames : List [str ] = []):
76
+ def build_cargo (manifest : str , do_list = False , build = False , push = False , all = False , rebuild = False , boring = False ,
77
+ experimental = False , verbose = False , imagenames : List [str ] = []):
76
78
if not (build or push or do_list ):
77
79
build = push = True
78
80
@@ -252,6 +254,20 @@ def resolve_config_reference(value):
252
254
version_vars ["VERSION" ] = version
253
255
version_vars ["IMAGE_VERSION" ] = image_version
254
256
257
+ is_exp = version_info .get ('experimental' )
258
+ exp_deps = version_info .get ('experimental_dependencies' , [])
259
+
260
+ if is_exp or exp_deps :
261
+ if not experimental :
262
+ print (f"[bold]{ image } :{ image_version } [/bold] is experimental and -E switch not given, skipping" )
263
+ continue
264
+ # check dependencies
265
+ print (f"[bold]{ image } :{ image_version } [/bold] is experimental" )
266
+ for dep in exp_deps :
267
+ if not os .path .exists (dep ):
268
+ print (f" [red]ERROR: dependency { dep } doesn't exist[/red]" )
269
+ return 1
270
+
255
271
dockerfile = version_info .get ('dockerfile' ) or image_info .dockerfile or 'Dockerfile'
256
272
dockerfile = dockerfile .format (** version_vars )
257
273
full_image = f"{ registry } /{ image } :{ image_version } "
0 commit comments