diff --git a/shippy/.idea/shippy.iml b/shippy/.idea/shippy.iml index bc0c4e9e..8e9d132c 100644 --- a/shippy/.idea/shippy.iml +++ b/shippy/.idea/shippy.iml @@ -2,9 +2,10 @@ + - + diff --git a/shippy/README.md b/shippy/README.md index 990140fd..ca27447a 100644 --- a/shippy/README.md +++ b/shippy/README.md @@ -61,3 +61,12 @@ directory. Use with caution. Same as the `-y`/`--yes` flag shown above. Enable debug mode for all invocations. When set to true, the `-d`/`--debug` flag will have no effect, and all invocations of shippy will run with debug mode enabled. + + +# Status + +shippy returns exit codes based on the results. + +`1` - Ctrl-C exit + +`2` - one or more builds failed to upload and/or set disabled status \ No newline at end of file diff --git a/shippy/shippy/__main__.py b/shippy/shippy/__main__.py index f37f68ea..a5706c00 100644 --- a/shippy/shippy/__main__.py +++ b/shippy/shippy/__main__.py @@ -47,6 +47,8 @@ console = Console() +failed_builds_exist = False + # Handle SIGINT gracefully and don't puke up traceback def sigint_handler(*_): @@ -67,6 +69,8 @@ def server_prechecks(client): def check_and_upload_build(client, args, build_path): + global failed_builds_exist + # Check build file validity if not check_build(client, build_path): print_warning("Invalid build. Skipping...") @@ -83,6 +87,7 @@ def check_and_upload_build(client, args, build_path): except UploadException as exception: logger.exception(exception) print_error(exception, newline=True, exit_after=False) + failed_builds_exist = True def search_and_upload_builds(client, args): @@ -413,6 +418,10 @@ def main(): # Start uploads search_and_upload_builds(client, args) + # Check exit condition + if failed_builds_exist: + exit(2) + if __name__ == "__main__": - main() + main() \ No newline at end of file