From d92523aaeb0066e846b3cb1dc154f5731a2e6247 Mon Sep 17 00:00:00 2001 From: rohitsakala Date: Wed, 18 Jan 2017 12:32:35 +0530 Subject: Add exit in build script to notify jenkins Jenkins job gives success even if swagger codegen fails, so added appropriate code to make jenkins build fail if swagger codegen fails. Change-Id: Ia8e61a7b37531ecfa16c7fd60bf8101d6da9fc5f Signed-off-by: rohitsakala --- utils/test/testapi/htmlize/doc-build.sh | 2 ++ utils/test/testapi/htmlize/htmlize.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'utils/test/testapi') diff --git a/utils/test/testapi/htmlize/doc-build.sh b/utils/test/testapi/htmlize/doc-build.sh index e492c97b5..427b4378b 100644 --- a/utils/test/testapi/htmlize/doc-build.sh +++ b/utils/test/testapi/htmlize/doc-build.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -o errexit + # Create virtual environment source $WORKSPACE/testapi_venv/bin/activate diff --git a/utils/test/testapi/htmlize/htmlize.py b/utils/test/testapi/htmlize/htmlize.py index 68d02febd..c07f98ecf 100644 --- a/utils/test/testapi/htmlize/htmlize.py +++ b/utils/test/testapi/htmlize/htmlize.py @@ -28,7 +28,10 @@ def main(args): # Generating html page cmd = 'java -jar swagger-codegen-cli.jar generate \ -i specs.json -l html2 -o %s' % (args.output_directory) - os.system(cmd) + if os.system(cmd) == 0: + exit(0) + else: + exit(1) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Create \ -- cgit 1.2.3-korg