Skip to content

Commit

Permalink
build-driver: handle sources before upload_daily
Browse files Browse the repository at this point in the history
Most importantly this deletes grml_sources before uploading to the daily host.
Saves us disk space and upload time.
  • Loading branch information
zeha committed Dec 19, 2024
1 parent 8b84591 commit 47f34ea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions build-driver/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,15 @@ def main(program_name: str, argv: list[str]) -> int:
old_iso_path,
)

# Remove the sources *directory*, to not have the sources twice in the CI artifacts.
grml_sources_directory = build_dir / "grml_sources"
if grml_sources_directory.exists():
print(f"I: Removing {grml_sources_directory}")
shutil.rmtree(grml_sources_directory, ignore_errors=True)

if old_sources_path:
old_sources_path.rename(build_dir / job_properties.sources_name)

if upload_to_daily:
upload_daily(job_properties.job_name, build_dir, job_properties.job_timestamp)

Expand All @@ -521,15 +530,6 @@ def main(program_name: str, argv: list[str]) -> int:
old_dpkg_list_previous_build.parent.mkdir(exist_ok=True)
shutil.copyfile(new_dpkg_list, old_dpkg_list_previous_build)

if old_sources_path:
old_sources_path.rename(build_dir / job_properties.sources_name)

# Remove the sources *directory*, to not have the sources twice in the CI artifacts.
grml_sources_directory = build_dir / "grml_sources"
if grml_sources_directory.exists():
print(f"I: Removing {grml_sources_directory}")
shutil.rmtree(grml_sources_directory, ignore_errors=True)

print("I: Success.")

return 0
Expand Down

0 comments on commit 47f34ea

Please sign in to comment.