From 8bc65b392679043f592350b9bcc8ffb85585b123 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 3 Jul 2013 15:41:46 -0700 Subject: [PATCH] Set curl to fail if HTTP servers return a error. * modules/openstack_project/files/jenkins_job_builder/config/pypi-jobs.yaml: Use the curl's --fail option to detect some HTTP 400 and 500 errors. Then check that the file is actually a gzipped file. The two checks are necessary because some HTTP error codes do not result in a non zero return from curl even with the --fail option. Change-Id: I796d2c5767e787e7106040e7ef0098886135e68c Reviewed-on: https://review.openstack.org/35562 Reviewed-by: Jeremy Stanley Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins --- .../files/jenkins_job_builder/config/pypi-jobs.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/openstack_project/files/jenkins_job_builder/config/pypi-jobs.yaml b/modules/openstack_project/files/jenkins_job_builder/config/pypi-jobs.yaml index 4b838ed795..7d43feb9be 100644 --- a/modules/openstack_project/files/jenkins_job_builder/config/pypi-jobs.yaml +++ b/modules/openstack_project/files/jenkins_job_builder/config/pypi-jobs.yaml @@ -9,7 +9,9 @@ FILENAME="{name}-$TAG.tar.gz" rm -rf *tar.gz - curl -o $FILENAME http://{tarball-site}/{name}/$FILENAME + curl --fail -o $FILENAME http://{tarball-site}/{name}/$FILENAME + # Make sure we actually got a gzipped file + file -b $FILENAME | grep gzip - shell: | /usr/local/jenkins/slave_scripts/pypi-upload.sh {name}