Skip to content
Snippets Groups Projects
Commit d63391d0 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Improve wheels uploading script to detect error conditions (closes #37)

parent d4f03f74
No related branches found
No related tags found
No related merge requests found
...@@ -161,15 +161,18 @@ setup_deploy() { ...@@ -161,15 +161,18 @@ setup_deploy() {
# Uploads a file to our intranet location via curl # Uploads a file to our intranet location via curl
# $1: Path to the file to upload (e.g. dist/myfile.whl)
# $2: Path on the server to upload to (e.g. wheels-upload/gitlab/)
doc_upload() { doc_upload() {
log_info "curl: ${1} -> ${DOCSERVER}/${2}..." log_info "curl: ${1} -> ${DOCSERVER}/${2}..."
curl --location --silent --show-error --user "${DOCUSER}:${DOCPASS}" --upload-file ${1} ${DOCSERVER}/${2} local code=`curl --location --silent --fail --write-out "%{http_code}" --user "${DOCUSER}:${DOCPASS}" --upload-file ${1} ${DOCSERVER}/${2}`
local status=$? if [[ ${code} == 204 || ${code} == 201 ]]; then
if [ ${status} != 0 ]; then log_info "Successfully uploaded ${1} with curl"
log_error "Curl command finished with an error condition (status=${status})" else
log_error "Curl command finished with an error condition (code=${code}):"
curl --location --silent --user "${DOCUSER}:${DOCPASS}" --upload-file ${1} ${DOCSERVER}/${2}
exit ${status} exit ${status}
fi fi
log_info "Successfully uploaded ${1} with curl"
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment