mirror of https://github.com/avast/PurpleDome
Tool to zip the project added
parent
93b8edadf7
commit
2d4f3d418d
@ -0,0 +1,68 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# A python tool to compress the relevant project files.
|
||||||
|
|
||||||
|
import glob
|
||||||
|
import zipfile
|
||||||
|
import os
|
||||||
|
|
||||||
|
filename = "shipit.zip"
|
||||||
|
|
||||||
|
globs = ["TODO.md",
|
||||||
|
".gitignore",
|
||||||
|
"*.py",
|
||||||
|
"CONTRIBUTING.txt",
|
||||||
|
"experiment.yaml",
|
||||||
|
"cloud_experiment.yaml",
|
||||||
|
"Makefile",
|
||||||
|
"*.sh",
|
||||||
|
"README.md",
|
||||||
|
"requirements.txt",
|
||||||
|
"tox.ini",
|
||||||
|
"app/*.py",
|
||||||
|
"tools/*.py",
|
||||||
|
"tests/*.py",
|
||||||
|
"systems/Vagrantfile",
|
||||||
|
"systems/*/*.sh",
|
||||||
|
"systems/azure_attacker"
|
||||||
|
"doc/source",
|
||||||
|
"doc/source/conf.py",
|
||||||
|
"doc/source/asciinema/*",
|
||||||
|
"doc/source/index.rst",
|
||||||
|
"doc/Makefile",
|
||||||
|
"doc/purpledome.pdf",
|
||||||
|
"doc/source/*/*.rst",
|
||||||
|
"doc/source/_static/*.png",
|
||||||
|
"doc/source/_templates/*",
|
||||||
|
"tests/data/*.yaml",
|
||||||
|
"plugins/base/*.py",
|
||||||
|
"plugins/default/*/*/*.py",
|
||||||
|
"plugins/default/*/*/*.txt",
|
||||||
|
"plugins/default/*/*/*.md",
|
||||||
|
"plugins/default/*/*/*.exe",
|
||||||
|
"plugins/default/*/*/*.dll",
|
||||||
|
"plugins/default/*/*/*.dll_*",
|
||||||
|
"plugins/default/*/*/*.reg",
|
||||||
|
"plugins/avast_internal_plugins/*/*/*.py",
|
||||||
|
"plugins/avast_internal_plugins/*/*/*.bat",
|
||||||
|
"plugins/avast_internal_plugins/*/*/*.txt",
|
||||||
|
"plugins/avast_internal_plugins/*/*/*.md",
|
||||||
|
"plugins/avast_internal_plugins/*/*/*.exe",
|
||||||
|
"plugins/avast_internal_plugins/*/*/*.dll",
|
||||||
|
"plugins/avast_internal_plugins/*/*/*.dll_*",
|
||||||
|
"plugins/avast_internal_plugins/*/*/*.reg",
|
||||||
|
"plugins/avast_internal_plugins/*/*/idpx",
|
||||||
|
"plugins/avast_internal_plugins/*/*/hosts",
|
||||||
|
"plugins/README.md",
|
||||||
|
"pylint.rc"]
|
||||||
|
|
||||||
|
try:
|
||||||
|
os.remove(filename)
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
with zipfile.ZipFile(filename, "w") as zfh:
|
||||||
|
for gs in globs:
|
||||||
|
for g in glob.iglob(gs, recursive=True):
|
||||||
|
print(g)
|
||||||
|
zfh.write(g)
|
Loading…
Reference in New Issue