diff --git a/build-yocto.yml b/build-yocto.yml index 8c8e6f70afedb9b7673b2b2394ae4f4d8eeb2a66..836a52b80fa02e793cd74ac980addaea7b609328 100644 --- a/build-yocto.yml +++ b/build-yocto.yml @@ -138,7 +138,3 @@ when: manual allow_failure: true timeout: 30m - -.uploadsdkftp: - variables: - ARTIFACTS_SDK_PATH: "$LOCALDIR/$BUILD_MACHINE/sdk" diff --git a/manifest-package.yml b/manifest-package.yml index edf99e6afd6d0d68afa01d3bb1ec82ee2c0f279e..5ee632be889f19e6d33b462443018a9d82c259c9 100644 --- a/manifest-package.yml +++ b/manifest-package.yml @@ -24,7 +24,7 @@ UPLOAD_PARAM="" # don't store as gitlab artifact OUTDIR_BASE="/artifacts-ftp" else - UPLOAD_PARAM="--outputdir-upload=release" + UPLOAD_PARAM="--output-dir=release" OUTDIR_BASE="/artifacts" fi @@ -64,7 +64,7 @@ --images-dir="${ARTIFACTS_IMAGE_PATH}" \ --licenses-dir="${ARTIFACTS_LICENSES_PATH}" \ --doc-dir=. \ - --outputdir-local=${outdir} \ + --output-dir=${outdir} \ $UPLOAD_PARAM else echo "${LOGPREFIX} No image found" @@ -76,7 +76,7 @@ echo "${LOGPREFIX} SDK dir found, execute ${script}" ${script} \ --sdk-dir=${ARTIFACTS_SDK_PATH} \ - --outputdir-local="${outdir}" + --output-dir="${outdir}" else echo "${LOGPREFIX} No SDK found" fi diff --git a/scripts/package_release.py b/scripts/package_release.py index 68773cfd5e6f21d403f0ef8690e0fcbd305e491f..0f482774ba3d054fd06b176fa594021d3fe3fe65 100755 --- a/scripts/package_release.py +++ b/scripts/package_release.py @@ -66,16 +66,6 @@ def main(): help="""Yocto licenses directory""", dest="licenses_dir", ) - parser.add_argument( - "--outputdir-upload", - help="""Base directory name for uploaded artifacts""", - dest="outputdir_upload", - ) - parser.add_argument( - "--outputdir-local", - help="""Base directory for locally deployed artifacts, should contain absolut path.""", - dest="outputdir_local", - ) parser.add_argument( "--sdk-dir", help="""Yocto sdk directory""", @@ -86,13 +76,15 @@ def main(): help="""Documentation directory""", dest="doc_dir", ) + parser.add_argument( + "--output-dir", + help="""Base directory name for output artifacts (can be specified multiple times)""", + dest="output_dir", + action="append", + required=True, + ) args, _ = parser.parse_known_args() - if args.outputdir_upload is None and args.outputdir_local is None: - sys.exit( - "ERROR: Either outputdir-local and/or outputdir-upload needs to be specified." - ) - # Get bitbake variables from testdata.json file testdata_files = [] if args.images_dir is not None: @@ -131,16 +123,11 @@ def main(): release_name = "Yocto-%s" % version # Create output directories - if args.outputdir_upload is not None: - outputdir_upload = os.path.join(args.outputdir_upload, release_name) - os.makedirs(outputdir_upload, exist_ok=True) - else: - outputdir_upload = None - if args.outputdir_local is not None: - outputdir_local = os.path.join(args.outputdir_local, release_name) - os.makedirs(outputdir_local, exist_ok=True) - else: - outputdir_local = None + output_dirs = [] + for output_dir in args.output_dir: + full_output_dir = os.path.join(output_dir, release_name) + output_dirs.append(full_output_dir) + os.makedirs(full_output_dir, exist_ok=True) # Package documentation files if args.doc_dir is not None: @@ -160,10 +147,8 @@ def main(): files.append(doc_md5sums_file) # Copy files - if outputdir_upload is not None: - copy_files(files, outputdir_upload) - if outputdir_local is not None: - copy_files(files, outputdir_local) + for output_dir in output_dirs: + copy_files(files, output_dir) # Package image files if args.images_dir is not None: @@ -203,10 +188,8 @@ def main(): artifacts.append(os.path.join(args.images_dir, "metainfo.json")) # Copy files - if outputdir_upload is not None: - copy_files(artifacts, os.path.join(outputdir_upload, machine)) - if outputdir_local is not None: - copy_files(artifacts, os.path.join(outputdir_local, machine)) + for output_dir in output_dirs: + copy_files(artifacts, os.path.join(output_dir, machine)) # Package SDK if args.sdk_dir is not None: @@ -218,14 +201,13 @@ def main(): sdkfiles.append(sdk_md5sums_file) # Copy files - if outputdir_local is not None: - copy_files(sdkfiles, os.path.join(outputdir_local, machine, "sdk")) + for output_dir in output_dirs: + copy_files(sdkfiles, output_dir) # Store pathes and other stuff in environment variable file with open("package.env", "w", encoding="utf-8") as env_file: env_file.write("VERSION={}\n".format(version)) env_file.write("MACHINE={}\n".format(machine)) - env_file.write("LOCALDIR={}\n".format(outputdir_local)) if __name__ == "__main__":