Stage ntfy output on installation filesystem before atomic replacement
This commit is contained in:
@@ -571,7 +571,10 @@ class Setup:
|
||||
source = Path(cache.stdout.strip()) / f"{module}@{version}"
|
||||
if not source.is_dir():
|
||||
raise ValueError(f"the Go module cache has no source for {pinned}")
|
||||
with tempfile.TemporaryDirectory(prefix="pipelines-ntfy-") as temporary:
|
||||
# Keep source work in the system temp directory, but stage the output
|
||||
# beside the destination: /tmp may be a different filesystem on Linux.
|
||||
with tempfile.TemporaryDirectory(prefix="pipelines-ntfy-") as temporary, \
|
||||
tempfile.TemporaryDirectory(prefix=".ntfy-", dir=path.parent) as staging:
|
||||
checkout = Path(temporary) / "src"
|
||||
shutil.copytree(source, checkout, symlinks=True)
|
||||
# The module cache is read-only and carries no built web assets; the
|
||||
@@ -581,7 +584,7 @@ class Setup:
|
||||
(checkout / "server/site").mkdir(parents=True, exist_ok=True)
|
||||
(checkout / "server/docs/index.html").touch()
|
||||
(checkout / "server/site/app.html").touch()
|
||||
built = Path(temporary) / "ntfy"
|
||||
built = Path(staging) / "ntfy"
|
||||
env = dict(self.environ)
|
||||
env["CGO_ENABLED"] = "1"
|
||||
build = self.runner(
|
||||
|
||||
Reference in New Issue
Block a user