Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
a0fff97f
Commit
a0fff97f
authored
8 years ago
by
James Goppert
Committed by
Lorenz Meier
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Moved deployment logic to python scripts.
parent
50159cab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitignore
+3
-2
3 additions, 2 deletions
.gitignore
.travis.yml
+1
-3
1 addition, 3 deletions
.travis.yml
Makefile
+1
-1
1 addition, 1 deletion
Makefile
Tools/package_firmware.py
+37
-0
37 additions, 0 deletions
Tools/package_firmware.py
Tools/s3_deploy.py
+44
-0
44 additions, 0 deletions
Tools/s3_deploy.py
with
86 additions
and
6 deletions
.gitignore
+
3
−
2
View file @
a0fff97f
...
...
@@ -20,8 +20,9 @@
Archives/*
Build/*
Testing/
Binaries/*
Meta/*
Packages/*
s3deploy-branch/
s3deploy-archive/
build/*
build_*/
core
...
...
This diff is collapsed.
Click to expand it.
.travis.yml
+
1
−
3
View file @
a0fff97f
...
...
@@ -78,9 +78,7 @@ script:
after_success
:
-
if [[ "${TRAVIS_OS_NAME}" = "linux" && "${TRAVIS_BRANCH}" != "coverity" ]]; then
make package_firmware && mkdir s3deploy-archive && cp Firmware.zip s3deploy-archive/
&& cp Binaries/* .
&& find . -maxdepth 1 -mindepth 1 -type f -name 'nuttx-*-default.px4' | sed 's/.\/nuttx-//' | sed 's/-default.px4//' | xargs -I{} mv nuttx-{}-default.px4 {}_default.px4
&& mkdir s3deploy-branch && mv *_default.px4 Meta/px4fmu-v4_default/parameters.xml Meta/px4fmu-v4_default/airframes.xml s3deploy-branch/;
&& Tools/s3_deploy.py;
fi
-
if [[ "${TRAVIS_OS_NAME}" = "linux" && "$GCC_VER" == "5.4" && "${TRAVIS_BRANCH}" != "coverity" ]]; then
export PX4_S3_DEPLOY=1;
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
1
−
1
View file @
a0fff97f
...
...
@@ -300,7 +300,7 @@ clang-tidy:
@$(
SRC_DIR
)
/Tools/clang-tool.sh
-b
build_posix_sitl_default
-t
clang-tidy
package_firmware
:
@
zip
--junk-paths
Firmware.zip
`
find Binaries/.
-name
\*
.px4
`
@
./Tools/package_firmware.py
clean
:
@
rm
-rf
build_
*
/
...
...
This diff is collapsed.
Click to expand it.
Tools/package_firmware.py
0 → 100755
+
37
−
0
View file @
a0fff97f
#!/usr/bin/env python
import
glob
import
zipfile
import
os
FIRMWARE_FILE
=
'
Firmware.zip
'
def
extract_file_only
(
filename
,
dest
):
"""
Extract a file without keeping directories.
"""
# extract firmware files without paths
f_src
=
archive
.
open
(
filename
,
'
r
'
)
data
=
f_src
.
read
()
dst_name
=
os
.
path
.
join
(
dest
,
os
.
path
.
basename
(
filename
))
with
open
(
dst_name
,
'
w
'
)
as
f_dst
:
f_dst
.
write
(
data
)
f_src
.
close
()
# open destination archive
with
zipfile
.
ZipFile
(
FIRMWARE_FILE
,
'
w
'
)
as
dest_archive
:
# get all zip files in Packages directory
for
zip_filename
in
glob
.
glob
(
"
Packages/*.zip
"
):
# open zipfile
with
zipfile
.
ZipFile
(
zip_filename
,
'
r
'
)
as
archive
:
# look for interesting names
for
src_filename
in
archive
.
namelist
():
# extract firmware files
if
os
.
path
.
splitext
(
src_filename
)[
1
]
==
'
.px4
'
:
base_name
=
os
.
path
.
basename
(
src_filename
)
dest_archive
.
writestr
(
base_name
,
archive
.
read
(
src_filename
))
This diff is collapsed.
Click to expand it.
Tools/s3_deploy.py
0 → 100755
+
44
−
0
View file @
a0fff97f
#!/usr/bin/env python
import
glob
import
zipfile
import
os
import
re
import
shutil
S3_DIR
=
'
s3deploy-branch
'
S3_ARCHIVE_DIR
=
'
s3deploy-branch
'
if
not
os
.
path
.
isdir
(
S3_DIR
):
os
.
mkdir
(
S3_DIR
)
if
not
os
.
path
.
isdir
(
S3_ARCHIVE_DIR
):
os
.
mkdir
(
S3_ARCHIVE_DIR
)
shutil
.
copyfile
(
Firmware
.
zip
,
S3_ARCHIVE_DIR
)
def
extract_file_only
(
filename
,
dest
):
# extract firmware files without paths
f_src
=
archive
.
open
(
filename
,
'
r
'
)
data
=
f_src
.
read
()
with
open
(
os
.
path
.
join
(
dest
,
os
.
path
.
basename
(
filename
)),
'
w
'
)
as
f_dst
:
f_dst
.
write
(
data
)
f_src
.
close
()
# get all zip files in Packages directory
for
zip_filename
in
glob
.
glob
(
"
Packages/*.zip
"
):
# open zipfile
with
zipfile
.
ZipFile
(
zip_filename
,
'
r
'
)
as
archive
:
# look for interesting names
for
filename
in
archive
.
namelist
():
# extract firmware files
if
os
.
path
.
splitext
(
filename
)[
1
]
==
'
.px4
'
:
extract_file_only
(
filename
,
S3_DIR
)
# copy px4fmu-v4_default xml files for qgroundcontrol
if
re
.
match
(
filename
,
r
'
.*px4fmu-v4_default.*\.xml
'
)
is
not
None
:
extract_file_only
(
filename
,
S3_DIR
)
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