Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: added os option for building latest docker images #508

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions build_latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,22 @@ source ./snyk.sh
# shellcheck source=dockerfile_functions.sh
source ./dockerfile_functions.sh

if [ $# -ne 4 ]; then
if [ $# -le 3 ]; then
echo
echo "usage: $0 version vm package runtype"
echo "usage: $0 version vm package runtype os(Optional)"
echo "version = ${supported_versions}"
echo "vm = ${all_jvms}"
echo "package = ${all_packages}"
echo "runtype = ${all_runtypes}"
echo "os = ${oses}"
exit 1
fi

set_version "$1"
vm="$2"
package="$3"
set_runtype "$4"
os_param=$(echo "$5" | tr "," " ")

# Get the image build time stored in the "build_time" array for the current arch
# Build time is stored as the time since 1-1-1970
Expand Down Expand Up @@ -360,6 +362,10 @@ function build_dockerfile {
# Set the OSes that will be built on based on the current arch
set_arch_os

if [ ! -z "${os_param}" ];then
oses=${os_param}
fi

# Updating `oses` for `test` runtype to reduce the build time for OpenJ9 images for PR checks
if [ "${runtype}" == "test" ] && [ "${vm}" == "openj9" ] && [ "${current_arch}" == "x86_64" ] && [ "${os_family}" == "linux" ]; then
oses="${PR_TEST_OSES}"
Expand Down