Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.admin
Commits
d63391d0
Commit
d63391d0
authored
8 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Improve wheels uploading script to detect error conditions (closes
#37
)
parent
d4f03f74
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gitlab/functions.sh
+8
-5
8 additions, 5 deletions
gitlab/functions.sh
with
8 additions
and
5 deletions
gitlab/functions.sh
+
8
−
5
View file @
d63391d0
...
@@ -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"
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment