Exit if return value diff than 0
This commit is contained in:
8
main.py
8
main.py
@@ -12,13 +12,17 @@ REPO_UPDATER_SCRIPT = os.getcwd() + '/update_repo.sh'
|
|||||||
|
|
||||||
def update_repositories():
|
def update_repositories():
|
||||||
for repo_path in config.git_repositories:
|
for repo_path in config.git_repositories:
|
||||||
os.system(f"{REPO_UPDATER_SCRIPT} {repo_path}")
|
ret = os.system(f"{REPO_UPDATER_SCRIPT} {repo_path}")
|
||||||
|
if ret > 0:
|
||||||
|
exit(ret)
|
||||||
|
|
||||||
|
|
||||||
def update_stack(stack):
|
def update_stack(stack):
|
||||||
project_name = stack['Name']
|
project_name = stack['Name']
|
||||||
compose_file = DOCKER_COMPOSE_PATH.format(stack['Id'])
|
compose_file = DOCKER_COMPOSE_PATH.format(stack['Id'])
|
||||||
os.system(f"{BASH_COMPANION_SCRIPT} {project_name} {compose_file}")
|
ret = os.system(f"{BASH_COMPANION_SCRIPT} {project_name} {compose_file}")
|
||||||
|
if ret > 0:
|
||||||
|
exit(ret)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user