Fix: create m2repo path for copy command 00/73300/6 master v0.90.11
authorKevin Sandi <ksandi@contractor.linuxfoundation.org>
Wed, 27 Nov 2024 16:55:22 +0000 (10:55 -0600)
committerKevin Sandi <ksandi@contractor.linuxfoundation.org>
Thu, 28 Nov 2024 16:20:44 +0000 (10:20 -0600)
Issue: RELENG-5637
Signed-off-by: Kevin Sandi <ksandi@contractor.linuxfoundation.org>
Change-Id: Ie1a19bc1531862cee490164beb95d22fcee88dd8

README.md
releasenotes/notes/fix-sbom-generator-c48b4e40496335d2.yaml [new file with mode: 0644]
shell/sbom-generator.sh

index 4549927..6a36993 100644 (file)
--- a/README.md
+++ b/README.md
@@ -13,38 +13,38 @@ projects save time from having to define their own job templates.
 
 ### [Install](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/)
 
 
 ### [Install](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/)
 
--   [Jenkins configuration](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/install.html#jenkins-configuration)
+- [Jenkins configuration](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/install.html#jenkins-configuration)
 
 
--   [ci-management](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/install.html#ci-management)
+- [ci-management](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/install.html#ci-management)
 
 
--   [Deploy ci-jobs](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/install.html#deploy-ci-jobs)
+- [Deploy ci-jobs](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/install.html#deploy-ci-jobs)
 
 
--   [Deploy packer-jobs](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/install.html#deploy-packer-jobs)
+- [Deploy packer-jobs](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/install.html#deploy-packer-jobs)
 
 ### [Configuration](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/configuration.html)
 
 
 ### [Configuration](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/configuration.html)
 
--   [defaults.yaml](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/configuration.html#defaults-yaml)
+- [defaults.yaml](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/configuration.html#defaults-yaml)
 
 
--   [Jenkins Files](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/configuration.html#jenkins-files)
+- [Jenkins Files](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/configuration.html#jenkins-files)
 
 
--   [Jenkins CI Jobs](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/configuration.html#jenkins-ci-jobs)
+- [Jenkins CI Jobs](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/configuration.html#jenkins-ci-jobs)
 
 
--   [Log Archiving](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/configuration.html#log-archiving)
+- [Log Archiving](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/configuration.html#log-archiving)
 
 ### [Best Practices](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html)
 
 
 ### [Best Practices](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html)
 
--   [JJB YAML Layout](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#jjb-yaml-layout)
+- [JJB YAML Layout](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#jjb-yaml-layout)
 
 
--   [Passing parameters to shell scripts](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#passing-parameters-to-shell-scripts)
+- [Passing parameters to shell scripts](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#passing-parameters-to-shell-scripts)
 
 
--   [Shell scripts](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#shell-scripts)
+- [Shell scripts](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#shell-scripts)
 
 
--   [Usage of config-file-provider](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#usage-of-config-file-provider)
+- [Usage of config-file-provider](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#usage-of-config-file-provider)
 
 
--   [Preserving Objects in Variable References](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#preserving-objects-in-variable-references)
+- [Preserving Objects in Variable References](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#preserving-objects-in-variable-references)
 
 
--   [Using single quotes around variables](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#using-single-quotes-around-variables)
+- [Using single quotes around variables](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#using-single-quotes-around-variables)
 
 
--   [Variable expansion and Defaults](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#variable-expansion-and-defaults)
+- [Variable expansion and Defaults](https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/best-practices.html#variable-expansion-and-defaults)
 
 ## For Detail Documentation [Global-JJB](http://docs.releng.linuxfoundation.org/projects/global-jjb)
 
 ## For Detail Documentation [Global-JJB](http://docs.releng.linuxfoundation.org/projects/global-jjb)
diff --git a/releasenotes/notes/fix-sbom-generator-c48b4e40496335d2.yaml b/releasenotes/notes/fix-sbom-generator-c48b4e40496335d2.yaml
new file mode 100644 (file)
index 0000000..2b802ee
--- /dev/null
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    Explicitly create m2repo path for copy command before moving files to it
+    as per sbom generator script was assuming the filesystem path exists and
+    it could not be the case.
index 2ffca28..eccb0ba 100644 (file)
@@ -45,8 +45,10 @@ if [[ "$JOB_NAME" =~ "maven" ]]; then
 
     mv "${WORKSPACE}/archives/bom-Java-Maven.spdx" \
         "${WORKSPACE}/archives/${PROJECT##*/}-sbom-${release_version}.spdx"
 
     mv "${WORKSPACE}/archives/bom-Java-Maven.spdx" \
         "${WORKSPACE}/archives/${PROJECT##*/}-sbom-${release_version}.spdx"
+    M2REPO_PATH="${WORKSPACE}/m2repo/${group_id_path}"
+    mkdir -p "${M2REPO_PATH}"
     cp "${WORKSPACE}/archives/${PROJECT##*/}-sbom-${release_version}.spdx" \
     cp "${WORKSPACE}/archives/${PROJECT##*/}-sbom-${release_version}.spdx" \
-        "${WORKSPACE}/m2repo/${group_id_path}/${PROJECT##*/}-sbom-${release_version}.spdx"
+        "${M2REPO_PATH}/${PROJECT##*/}-sbom-${release_version}.spdx"
 fi
 
 mv spdx-sbom-generator /tmp/
 fi
 
 mv spdx-sbom-generator /tmp/