Arrêt du processus en cas d'erreur

This commit is contained in:
wpetit 2017-03-20 18:35:59 +01:00
parent 6d5e898cb8
commit d99305182e
4 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -e
${TAMARIN_ACBUILD} environment add DEBIAN_FRONTEND noninteractive
if [ "${TAMARIN_ACBUILD_ENGINE}" == 'chroot' ]; then

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -e
${TAMARIN_ACBUILD} environment add DEBIAN_FRONTEND noninteractive
sudo -E /usr/bin/env bash - <<EOF
export PATH=${PATH}

View File

@ -9,7 +9,7 @@ def run(args, as_root = False, capture_output=False, debug=False):
if capture_output:
return subprocess.check_output(cmd, stdin=subprocess.PIPE)
else:
return subprocess.call(cmd, stdin=subprocess.PIPE)
return subprocess.check_call(cmd, stdin=subprocess.PIPE)
def get_images_list(rkt_flags = [], debug=False):
output = run([

View File

@ -12,9 +12,7 @@ def run_profile_hooks(profile, step, cwd=None, env=None, debug=False):
if not trimmed_hook_name:
continue
hook_path = os.path.join(hooks_dir, trimmed_hook_name)
code = subprocess.call(hook_path, cwd=cwd, stdin=subprocess.PIPE, env=env)
if code != 0:
raise Exception("Hook '{:s}' exited with a non zero code ({:d}) !".format(trimmed_hook_name, code))
code = subprocess.check_call(hook_path, cwd=cwd, stdin=subprocess.PIPE, env=env)
def get_hooks_dir():
return os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + "/../hooks")
@ -86,4 +84,4 @@ def run_acbuild(args, captureOutput=False, as_root=False, debug=False):
if captureOutput:
return subprocess.check_output(cmd, stdin=subprocess.PIPE)
else:
return subprocess.call(cmd, stdin=subprocess.PIPE)
return subprocess.check_call(cmd, stdin=subprocess.PIPE)