@@ -211,13 +211,30 @@ def trial_build_main(args=None, local_base_build=True):
211211
212212 if not args .skip_build_images :
213213 logging .info ('Starting "Build and Push Images" phase...' )
214- if local_base_build :
215- build_and_push_test_images .build_and_push_images (test_image_tag ,
216- args .version_tag )
217- else :
218- if not build_and_push_test_images .gcb_build_and_push_images (
219- test_image_tag , version_tag = args .version_tag ):
220- return handle_phase1_failure (args .version_tag )
214+
215+ versions_to_build = ([args .version_tag ] if args .version_tag else
216+ build_and_push_test_images .BASE_IMAGE_VERSIONS )
217+
218+ for version in versions_to_build :
219+ logging .info (
220+ '================================================================' )
221+ logging .info (' BUILDING BASE IMAGES FOR VERSION: %s' ,
222+ version .upper ())
223+ logging .info (
224+ '================================================================' )
225+ version_test_image_tag = f'{ TEST_IMAGE_SUFFIX } -{ version } '
226+ if args .branch :
227+ version_test_image_tag = (
228+ f'{ version_test_image_tag } -{ args .branch .lower ().replace ("/" , "-" )} ' )
229+
230+ if local_base_build :
231+ build_and_push_test_images .build_and_push_images (
232+ version_test_image_tag , version )
233+ else :
234+ if not build_and_push_test_images .gcb_build_and_push_images (
235+ version_test_image_tag , version_tag = version ):
236+ return handle_phase1_failure (version )
237+
221238 logging .info ('"Build and Push Images" phase completed.' )
222239 else :
223240 logging .info (
0 commit comments