mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Rename dangerzone-converter to container
This commit is contained in:
parent
3e11dc11e0
commit
2de2b6dca5
9 changed files with 25 additions and 27 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -134,6 +134,6 @@ deb_dist
|
|||
.DS_Store
|
||||
install/windows/Dangerzone.wxs
|
||||
test_docs/sample-safe.pdf
|
||||
share/dangerzone-converter.tar
|
||||
share/dangerzone-converter.tar.gz
|
||||
share/container.tar
|
||||
share/container.tar.gz
|
||||
share/image-id.txt
|
||||
|
|
|
@ -25,7 +25,7 @@ class GlobalCommon(object):
|
|||
with open(self.get_resource_path("version.txt")) as f:
|
||||
self.version = f.read().strip()
|
||||
except FileNotFoundError:
|
||||
# In dev mode, in Windows, get_resource_path doesn't work properly for dangerzone-container, but luckily
|
||||
# In dev mode, in Windows, get_resource_path doesn't work properly for the container, but luckily
|
||||
# it doesn't need to know the version
|
||||
self.version = "unknown"
|
||||
|
||||
|
@ -435,10 +435,8 @@ class GlobalCommon(object):
|
|||
startupinfo=self.get_subprocess_startupinfo(),
|
||||
)
|
||||
|
||||
chunk_size = 1024
|
||||
compressed_container_path = self.get_resource_path(
|
||||
"dangerzone-converter.tar.gz"
|
||||
)
|
||||
chunk_size = 10240
|
||||
compressed_container_path = self.get_resource_path("container.tar.gz")
|
||||
with gzip.open(compressed_container_path) as f:
|
||||
while True:
|
||||
chunk = f.read(chunk_size)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "Building dangerzone-converter image"
|
||||
podman build dangerzone-converter --tag dangerzone.rocks/dangerzone
|
||||
echo "Building container image"
|
||||
podman build container --tag dangerzone.rocks/dangerzone
|
||||
|
||||
echo "Saving dangerzone-converter image"
|
||||
podman save dangerzone.rocks/dangerzone -o share/dangerzone-converter.tar
|
||||
echo "Saving container image"
|
||||
podman save dangerzone.rocks/dangerzone -o share/container.tar
|
||||
|
||||
echo "Compressing dangerzone-converter image"
|
||||
gzip -f share/dangerzone-converter.tar
|
||||
echo "Compressing container image"
|
||||
gzip -f share/container.tar
|
||||
|
||||
echo "Looking up the image id"
|
||||
podman image ls dangerzone.rocks/dangerzone | grep "dangerzone.rocks/dangerzone" | tr -s ' ' | cut -d' ' -f3 > share/image-id.txt
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "Building dangerzone-converter image"
|
||||
docker build dangerzone-converter --tag dangerzone.rocks/dangerzone
|
||||
echo "Building container image"
|
||||
docker build container --tag dangerzone.rocks/dangerzone
|
||||
|
||||
echo "Saving dangerzone-converter image"
|
||||
docker save dangerzone.rocks/dangerzone -o share/dangerzone-converter.tar
|
||||
echo "Saving container image"
|
||||
docker save dangerzone.rocks/dangerzone -o share/container.tar
|
||||
|
||||
echo "Compressing dangerzone-converter image"
|
||||
gzip -f share/dangerzone-converter.tar
|
||||
echo "Compressing container image"
|
||||
gzip -f share/container.tar
|
||||
|
||||
echo "Looking up the image id"
|
||||
docker image ls dangerzone.rocks/dangerzone | grep "dangerzone.rocks/dangerzone" | tr -s ' ' | cut -d' ' -f3 > share/image-id.txt
|
||||
|
|
|
@ -4,32 +4,32 @@ import os
|
|||
|
||||
|
||||
def main():
|
||||
print("Building dangerzone-converter image")
|
||||
print("Building container image")
|
||||
subprocess.run(
|
||||
[
|
||||
"docker",
|
||||
"build",
|
||||
"dangerzone-converter",
|
||||
"container",
|
||||
"--tag",
|
||||
"dangerzone.rocks/dangerzone",
|
||||
]
|
||||
)
|
||||
|
||||
print("Saving dangerzone-converter image")
|
||||
print("Saving container image")
|
||||
subprocess.run(
|
||||
[
|
||||
"docker",
|
||||
"save",
|
||||
"dangerzone.rocks/dangerzone",
|
||||
"-o",
|
||||
"share/dangerzone-converter.tar",
|
||||
"share/container.tar",
|
||||
]
|
||||
)
|
||||
|
||||
print("Compressing dangerzone-converter image")
|
||||
print("Compressing container image")
|
||||
chunk_size = 1024
|
||||
with open("share/dangerzone-converter.tar", "rb") as f:
|
||||
with gzip.open("share/dangerzone-converter.tar.gz", "wb") as gzip_f:
|
||||
with open("share/container.tar", "rb") as f:
|
||||
with gzip.open("share/container.tar.gz", "wb") as gzip_f:
|
||||
while True:
|
||||
chunk = f.read(chunk_size)
|
||||
if len(chunk) > 0:
|
||||
|
@ -37,7 +37,7 @@ def main():
|
|||
else:
|
||||
break
|
||||
|
||||
os.remove("share/dangerzone-converter.tar")
|
||||
os.remove("share/container.tar")
|
||||
|
||||
print("Looking up the image id")
|
||||
image_id = subprocess.check_output(
|
||||
|
|
Loading…
Reference in a new issue