INNER CODE UNIT · Python
build
varunsalian/debrify · tool/webdav_memory_stress/run.py:83
def build():
# Only the worker, pinned dependencies and selected production source files
# enter the local Docker build. No Flutter SDK, app secrets or user data.
with tempfile.TemporaryDirectory(prefix="debrify-memory-build-") as temp:
context = pathlib.Path(temp) / "context"
context.mkdir()
image_id_file = pathlib.Path(temp) / "image-id"
for name in BUILD_FILES:
shutil.copy2(HERE / name, context / name)
for relative in SOURCES:
target = context / "lib" / relative
target.parent.mkdir(parents=True, exist_ok=True)
shutil.copy2(ROOT / "lib" / relative, target)
fingerprint = input_fingerprint(context)
command(
"docker", "build", "--iidfile", str(image_id_file),
"--label", f"{INPUT_LABEL}={fingerprint['inputDigest']}",
"--label", f"{PROVENANCE_LABEL}={json.dumps(fingerprint, sort_keys=True)}",