Skip to content

Commit

Permalink
Enhance SBOM and JDK file check (#4078)
Browse files Browse the repository at this point in the history
* update params check

* check if default sbom and jdk available

Signed-off-by: Sophia Guo <[email protected]>

* check if default sbom and jdk available

* Format

Signed-off-by: Sophia Guo <[email protected]>

* update ERROR to info to avoid exit the test early

Signed-off-by: Sophia Guo <[email protected]>

* update usage message

---------

Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo authored Dec 8, 2024
1 parent fb389e7 commit 10376ad
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
25 changes: 18 additions & 7 deletions test/system/reproducibleCompare/reproducible.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,29 @@
# ********************************************************************************

ifndef SBOM_FILE
SBOM_FILE := $(shell ls $(TEST_ROOT)/../jdkbinary/ | grep "sbom" | grep -v "metadata")
SBOM_FILE := $(TEST_ROOT)/../jdkbinary/$(SBOM_FILE)
SBOM_FILE := $(shell ls $(TEST_ROOT)/../jdkbinary/ | grep "sbom" | grep -v "metadata")
ifeq ($(strip $(SBOM_FILE)),)
$(info ERROR! NO SBOM_FILE AVAILABLE)
SBOM_FILE :=
else
SBOM_FILE := $(TEST_ROOT)/../jdkbinary/$(SBOM_FILE)
endif
endif

ifndef JDK_FILE
JDK_FILE := $(shell find $(TEST_ROOT)/../jdkbinary/ -type f -name '*-jdk_*.tar.gz')
ifneq (,$(findstring win,$(SPEC)))
JDK_FILE := $(shell find $(TEST_ROOT)/../jdkbinary/ -type f -name '*-jdk_*.zip')
endif
JDK_FILE := $(shell find $(TEST_ROOT)/../jdkbinary/ -type f -name '*-jdk_*.tar.gz')
ifneq (,$(findstring win,$(SPEC)))
JDK_FILE := $(shell find $(TEST_ROOT)/../jdkbinary/ -type f -name '*-jdk_*.zip')
endif
ifeq ($(strip $(JDK_FILE)),)
$(info ERROR! NO JDK_FILE AVAILABLE)
endif
endif

ifneq (,$(findstring linux,$(SPEC)))
SBOM_FILE := $(subst $(TEST_ROOT)/../jdkbinary,/home/jenkins/test,$(SBOM_FILE))
ifneq ($(strip $(SBOM_FILE)),)
SBOM_FILE := $(subst $(TEST_ROOT)/../jdkbinary,/home/jenkins/test,$(SBOM_FILE))
endif
endif

RM_DEBUGINFO := $(shell find $(TEST_JDK_HOME) -type f -name "*.debuginfo" -delete)
2 changes: 1 addition & 1 deletion tooling/reproducible/macos_repro_build_compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set -e

# Check All 3 Params Are Supplied
if [ "$#" -lt 3 ]; then
echo "Usage: $0 SBOM_URL/SBOM_PATH JDKZIP_URL/JDKZIP_PATH"
echo "Usage: $0 SBOM_URL/SBOM_PATH JDKZIP_URL/JDKZIP_PATH REPORT_DIR"
echo ""
echo "1. SBOM_URL/SBOM_PATH - should be the FULL path OR a URL to a Temurin JDK SBOM JSON file in CycloneDX Format"
echo " eg. https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-sbom_x64_mac_hotspot_21.0.3_9.json"
Expand Down
6 changes: 4 additions & 2 deletions tooling/reproducible/windows_repro_build_compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@
set -e

# Check All 3 Params Are Supplied
if [ "$#" -lt 2 ]; then
echo "Usage: $0 SBOM_URL/SBOM_PATH JDKZIP_URL/JDKZIP_PATH"
if [ "$#" -lt 3 ]; then
echo "Usage: $0 SBOM_URL/SBOM_PATH JDKZIP_URL/JDKZIP_PATH REPORT_DIR"
echo ""
echo "1. SBOM_URL/SBOM_PATH - should be the FULL path OR a URL to a Temurin JDK SBOM JSON file in CycloneDX Format"
echo " eg. https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2%2B13/OpenJDK21U-sbom_x64_windows_hotspot_21.0.2_13.json"
echo ""
echo "2. JDKZIP_URL/JDKZIP_PATH - should be the FULL path OR a URL to a Temurin Windows JDK Zip file"
echo " eg. https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2%2B13/OpenJDK21U-jdk_x64_windows_hotspot_21.0.2_13.zip"
echo ""
echo "3. REPORT_DIR - should be the FULL path OR a URL to the output directory for the comparison report"
echo ""
exit 1
fi

Expand Down

0 comments on commit 10376ad

Please sign in to comment.