Skip to content

Commit 5c67185

Browse files
committed
build needs to fail if image is not produced
1 parent c720f7f commit 5c67185

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

singularity/build/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ def run_build(build_dir, params, verbose=True):
124124
build_folder=build_dir,
125125
isolated=True)
126126

127+
# If the image is None, the build has failed
128+
if image == None:
129+
final_time = (datetime.now() - start_time).seconds
130+
bot.info("Image failed build: build end %s seconds." %final_time)
131+
sys.exit(1)
132+
127133
# Save has for metadata (also is image name)
128134
version = get_image_file_hash(image)
129135
params['version'] = version

0 commit comments

Comments
 (0)