From 4eb9ea0f788485300a004e841c98e408cf8c8213 Mon Sep 17 00:00:00 2001 From: Kevin Sandi Date: Wed, 27 Nov 2024 10:55:22 -0600 Subject: [PATCH] Fix: create m2repo path for copy command Issue: RELENG-5637 Signed-off-by: Kevin Sandi Change-Id: Ie1a19bc1531862cee490164beb95d22fcee88dd8 --- README.md | 30 +++++++++++----------- .../notes/fix-sbom-generator-c48b4e40496335d2.yaml | 6 +++++ shell/sbom-generator.sh | 4 ++- 3 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 releasenotes/notes/fix-sbom-generator-c48b4e40496335d2.yaml diff --git a/README.md b/README.md index 45499278..6a369935 100644 --- 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/) -- [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) -- [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) -- [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) diff --git a/releasenotes/notes/fix-sbom-generator-c48b4e40496335d2.yaml b/releasenotes/notes/fix-sbom-generator-c48b4e40496335d2.yaml new file mode 100644 index 00000000..2b802eee --- /dev/null +++ b/releasenotes/notes/fix-sbom-generator-c48b4e40496335d2.yaml @@ -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. diff --git a/shell/sbom-generator.sh b/shell/sbom-generator.sh index 2ffca284..eccb0ba2 100644 --- a/shell/sbom-generator.sh +++ b/shell/sbom-generator.sh @@ -45,8 +45,10 @@ if [[ "$JOB_NAME" =~ "maven" ]]; then 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" \ - "${WORKSPACE}/m2repo/${group_id_path}/${PROJECT##*/}-sbom-${release_version}.spdx" + "${M2REPO_PATH}/${PROJECT##*/}-sbom-${release_version}.spdx" fi mv spdx-sbom-generator /tmp/ -- 2.16.6