Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Firmware Downloader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
firmware
FFS Firmware Downloader
Commits
afe1dbf9
Commit
afe1dbf9
authored
4 years ago
by
Nico
Browse files
Options
Downloads
Patches
Plain Diff
use WGET for downloading
WGET can retry automatically, so use it.
parent
04ef4022
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
download-latest-firmware-build.py
+6
-5
6 additions, 5 deletions
download-latest-firmware-build.py
with
6 additions
and
5 deletions
download-latest-firmware-build.py
+
6
−
5
View file @
afe1dbf9
...
@@ -84,11 +84,12 @@ pipeline_jobs_request.raise_for_status()
...
@@ -84,11 +84,12 @@ pipeline_jobs_request.raise_for_status()
pipeline_jobs
=
pipeline_jobs_request
.
json
()
pipeline_jobs
=
pipeline_jobs_request
.
json
()
for
job
in
pipeline_jobs
:
for
job
in
pipeline_jobs
:
if
job
[
"
name
"
]
==
"
package
"
:
if
job
[
"
name
"
]
==
"
package
"
:
with
tempfile
.
TemporaryFile
()
as
artifact_temp
:
with
tempfile
.
NamedTemporaryFile
()
as
artifact_temp
:
with
requests
.
get
(
"
{}/projects/{}/jobs/{}/artifacts
"
.
format
(
GITLAB_API_BASE
,
PROJECT_ID
,
job
[
"
id
"
]),
stream
=
True
)
as
artifact_request
:
artifact_url
=
"
{}/projects/{}/jobs/{}/artifacts
"
.
format
(
GITLAB_API_BASE
,
PROJECT_ID
,
job
[
"
id
"
])
artifact_request
.
raise_for_status
()
logging
.
debug
(
"
Starting download via wget of URL
'
{}
'"
.
format
(
artifact_url
))
for
chunk
in
artifact_request
.
iter_content
(
chunk_size
=
1024
*
1024
):
wget_process
=
subprocess
.
run
([
"
wget
"
,
"
-O
"
+
artifact_temp
.
name
,
artifact_url
],
encoding
=
'
utf-8
'
)
artifact_temp
.
write
(
chunk
)
if
wget_process
.
returncode
!=
0
:
print
(
wget_process
.
stdout
)
downloaded_version
=
extract_zip
(
artifact_temp
)
downloaded_version
=
extract_zip
(
artifact_temp
)
...
...
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