From c18d32a5fc9b3b4b674187b54c44c5d0ba06774e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20H=C3=B6ppner?= <jonas.hoeppner@garz-fricke.com>
Date: Fri, 19 Mar 2021 16:13:29 +0100
Subject: [PATCH] CI, release task: Use list created in yocto, don't rename
 files

Don't rename the release artifacts, just copy to a versioned folder.
The list of files to copy is taken from variables set in yocto
DISTRO_ARTIFACTS and DISTRO_IMAGES.
Images are linked, all other files are copied.

BCS 746-000273
---
 package_release.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/package_release.py b/package_release.py
index 8cac11ea..05644aa7 100755
--- a/package_release.py
+++ b/package_release.py
@@ -40,25 +40,25 @@ def main():
     # Set directories (use relative path)
     release_name = "GUF-Yocto-%s" % version
     output_dir = "%s/%s/%s" % (args.release_dir, release_name, machine)
-    images_dir = os.path.relpath(args.images_dir, output_dir)
+    images_dir_relative = os.path.relpath(args.images_dir, output_dir)
 
     # Create output directory
     os.makedirs(output_dir, exist_ok=True)
 
-    # Create symlinks for all artifacts
+    # Create symlinks for all images (to reduce size and network load)
     for artifact in artifacts_image:
-        source_file = "%s/%s" % (images_dir, artifact)
+        source_file = "%s/%s" % (images_dir_relative, artifact)
         target_file = "%s/%s" % (output_dir, artifact)
-        print("%s -> %s" % (target_file, source_file))
+        print("Create link: %s -> %s" % (target_file, source_file))
         os.symlink(source_file, target_file)
 
-    # Create symlinks for all artifacts
+    # Copy all other artifacts
     for artifact in artifacts_all:
         if artifact in artifacts_image:
             continue
-        source_file = "%s/%s" % (images_dir, artifact)
+        source_file = "%s/%s" % (args.images_dir, artifact)
         target_file = "%s/%s" % (output_dir, artifact)
-        print("%s -> %s" % (target_file, source_file))
+        print("Copy: %s -> %s" % (target_file, source_file))
         shutil.copyfile(source_file, target_file, follow_symlinks=True)
 
 
-- 
GitLab