Skip to content

Commit 250c729

Browse files
committed
Remove check_version in common_functions.sh
- remove check_version function - remove set_version function Signed-off-by: Anna Babu Palathingal <[email protected]>
1 parent 9abb319 commit 250c729

File tree

4 files changed

+54
-86
lines changed

4 files changed

+54
-86
lines changed

external/build_all.sh

+13-16
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,24 @@ cleanup_images
2525
# Loop through all possible images
2626
for test in ${supported_tests}
2727
do
28-
for version in ${supported_versions}
28+
for vm in ${supported_jvms}
2929
do
30-
for vm in ${supported_jvms}
30+
for os in ${supported_os}
3131
do
32-
for os in ${supported_os}
32+
for package in ${supported_packages}
3333
do
34-
for package in ${supported_packages}
34+
for build in ${supported_builds}
3535
do
36-
for build in ${supported_builds}
37-
do
38-
echo "==============================================================================="
39-
echo " "
40-
echo " Building Docker Images for ${test} ${version} ${vm} ${os} ${package} ${build} "
41-
echo " "
42-
echo "==============================================================================="
43-
$(dirname "$0")/build_image.sh ${test} ${version} ${vm} ${os} ${package} ${build}
44-
echo
45-
echo
46-
done
36+
echo "==============================================================================="
37+
echo " "
38+
echo " Building Docker Images for ${test} ${vm} ${os} ${package} ${build} "
39+
echo " "
40+
echo "==============================================================================="
41+
$(dirname "$0")/build_image.sh ${test} ${vm} ${os} ${package} ${build}
42+
echo
43+
echo
4744
done
4845
done
4946
done
5047
done
51-
done
48+
done

external/build_image.sh

+23-24
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ source $(dirname "$0")/dockerfile_functions.sh
1919
buildArg=""
2020
container_build="docker build"
2121

22-
if [ $# -ne 9 ] && [ $# -ne 10 ]; then
22+
if [ $# -ne 8 ] && [ $# -ne 9 ]; then
2323
echo "The supported tests are ${supported_tests}"
2424
echo
2525
echo "usage: $0 test version vm os package build platform check_external_custom"
2626
echo "test = ${supported_tests}"
27-
echo "version = ${supported_versions}"
27+
# echo "version = ${supported_versions}"
2828
echo "vm = ${supported_jvms}"
2929
echo "os = ${supported_os}"
3030
echo "package = ${supported_packages}"
@@ -35,36 +35,35 @@ if [ $# -ne 9 ] && [ $# -ne 10 ]; then
3535
echo "buildArg" = "Optional: customized image"
3636
exit -1
3737
fi
38-
if [ $# -eq 10 ]; then
39-
buildArg="--build-arg IMAGE=$10"
38+
if [ $# -eq 9 ]; then
39+
buildArg="--build-arg IMAGE=$9"
4040
fi
41-
check_external_custom=$9
41+
check_external_custom=$8
4242
if [[ "${check_external_custom}" == "0" ]]; then
4343
set_test $1
4444
fi
45-
set_version $2
46-
set_vm $3
47-
set_os $4
48-
set_package $5
49-
set_build $6
50-
set_platform $7
51-
set_base_docker_registry_dir "$8"
45+
set_vm $2
46+
set_os $3
47+
set_package $4
48+
set_build $5
49+
set_platform $6
50+
set_base_docker_registry_dir "$7"
5251

5352
# Build the Docker image with the given repo, build, build type and tags.
5453
function build_image() {
5554
local file=$1
5655
local test=$2
57-
local version=$3
58-
local vm=$4
59-
local os=$5
60-
local package=$6
61-
local build=$7
62-
local platform=$8
63-
local buildArg=$9
56+
# local version=$3
57+
local vm=$3
58+
local os=$4
59+
local package=$5
60+
local build=$6
61+
local platform=$7
62+
local buildArg=$8
6463

6564
echo "The test in the build_image() function is ${test}"
6665
# Used for tagging the image
67-
tags="adoptopenjdk-${test}-test:${version}-${package}-${os}-${vm}-${build}"
66+
tags="adoptopenjdk-${test}-test:${package}-${os}-${vm}-${build}"
6867
if [[ "$test" == *"criu"* ]]; then
6968
container_build="sudo podman build"
7069
fi
@@ -81,17 +80,17 @@ function build_image() {
8180

8281
# Handle making the directory for organizing the Dockerfiles
8382
if [[ "${check_external_custom}" == "1" ]]; then
84-
dir="$(realpath $(dirname "$0"))/external_custom/dockerfile/${version}/${package}/${os}"
83+
dir="$(realpath $(dirname "$0"))/external_custom/dockerfile/${package}/${os}"
8584
else
86-
dir="$(realpath $(dirname "$0"))/${test}/dockerfile/${version}/${package}/${os}"
85+
dir="$(realpath $(dirname "$0"))/${test}/dockerfile/${package}/${os}"
8786
fi
8887
mkdir -p ${dir}
8988

9089
# File Path to Dockerfile
9190
file="${dir}/Dockerfile.${vm}.${build}"
9291

9392
# Generate Dockerfile
94-
generate_dockerfile ${file} ${test} ${version} ${vm} ${os} ${package} ${build} ${platform} "${base_docker_registry_dir}" ${check_external_custom}
93+
generate_dockerfile ${file} ${test} ${vm} ${os} ${package} ${build} ${platform} "${base_docker_registry_dir}" ${check_external_custom}
9594

9695
# Check if Dockerfile exists
9796
if [ ! -f ${file} ]; then
@@ -100,4 +99,4 @@ if [ ! -f ${file} ]; then
10099
fi
101100

102101
# Build Dockerfile that was generated
103-
build_image ${file} ${test} ${version} ${vm} ${os} ${package} ${build} ${platform} "${buildArg}"
102+
build_image ${file} ${test} ${vm} ${os} ${package} ${build} ${platform} "${buildArg}"

external/common_functions.sh

+1-29
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
#
15-
16-
# Supported versions
17-
supported_versions="8 11 17 21 22"
18-
1915
# Supported JVMs
2016
supported_jvms="hotspot openj9"
2117

@@ -32,30 +28,6 @@ supported_builds="full"
3228
# Supported tests
3329
supported_tests="external_custom camel criu-functional criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tomcat tomee wildfly wycheproof netty spring zookeeper"
3430

35-
function check_version() {
36-
version=$1
37-
38-
for current_version in ${supported_versions}
39-
do
40-
if [[ "${version}" == "${current_version}" ]]; then
41-
return 1
42-
fi
43-
done
44-
45-
return 0
46-
}
47-
48-
# Set a valid version
49-
function set_version() {
50-
version=$1
51-
52-
if (check_version ${version}); then
53-
echo "ERROR: Invalid Version: ${version}"
54-
echo "Usage: $0 [${supported_versions}]"
55-
exit 1
56-
fi
57-
}
58-
5931
function check_os() {
6032
os=$1
6133

@@ -213,7 +185,7 @@ function set_test_info() {
213185
check_external_custom_test=$2
214186
cd ../
215187
path_to_file=$(pwd)
216-
echo ${path_to_file}
188+
echo ${path_to_file}
217189
PROPERTY_FILE=${path_to_file}/${test}/test.properties
218190
github_url=$(getProperty "github_url")
219191
test_options=$(getProperty "test_options")

external/dockerfile_functions.sh

+17-17
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@ sanitize_test_names() {
7676
print_image_args() {
7777
local file=$1
7878
local os=$2
79-
local version=$3
80-
local vm=$4
81-
local package=$5
82-
local build=$6
83-
local base_docker_registry_dir="$7"
79+
# local version=$3
80+
local vm=$3
81+
local package=$4
82+
local build=$5
83+
local base_docker_registry_dir="$6"
8484

8585
image_name="eclipse-temurin"
8686
tag=""
8787
if [[ "${package}" == "jre" ]]; then
88-
tag="${version}-jre"
88+
tag="jre"
8989
else
90-
tag="${version}-jdk"
90+
tag="jdk"
9191
fi
9292
if [[ "${vm}" == "openj9" ]]; then
9393
if [[ "${os}" == "ubuntu" ]]; then
@@ -459,7 +459,7 @@ print_test_files() {
459459
local test=$2
460460
local localPropertyFile=$3
461461

462-
if [[ "$check_external_custom_test" == "1" ]]; then
462+
if [[ "$check_external_custom_test" == "1" ]]; then
463463
echo -e "# This is the main script to run ${test} tests" \
464464
"\nCOPY external_custom/test.sh /test.sh" \
465465
"\nCOPY test_base_functions.sh test_base_functions.sh\n" >> ${file}
@@ -559,14 +559,14 @@ remove_trailing_spaces() {
559559
generate_dockerfile() {
560560
file=$1
561561
test=$2
562-
version=$3
563-
vm=$4
564-
os=$5
565-
package=$6
566-
build=$7
567-
platform=$8
568-
base_docker_registry_dir="$9"
569-
check_external_custom_test=$10
562+
# version=$3
563+
vm=$3
564+
os=$4
565+
package=$5
566+
build=$6
567+
platform=$7
568+
base_docker_registry_dir="$8"
569+
check_external_custom_test=$9
570570

571571

572572
if [[ "$check_external_custom_test" == "1" ]]; then
@@ -586,7 +586,7 @@ generate_dockerfile() {
586586
echo -n "Writing ${file} ... "
587587
print_legal ${file};
588588
print_adopt_test ${file} ${test};
589-
print_image_args ${file} ${os} ${version} ${vm} ${package} ${build} "${base_docker_registry_dir}";
589+
print_image_args ${file} ${os} ${vm} ${package} ${build} "${base_docker_registry_dir}";
590590
print_result_comment_arg ${file};
591591
print_test_tag_arg ${file} ${test} ${tag_version};
592592
print_${os}_pkg ${file} "${!packages}";

0 commit comments

Comments
 (0)