Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions ansible/pbTestScripts/buildJDK.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ processArgs() {
case "$opt" in
"--version" | "-v" )
if [ $1 == "jdk" ]; then
JAVA_TO_BUILD=$JDK_MAX
export JAVA_TO_BUILD=$JDK_MAX
else
JAVA_TO_BUILD=$(echo $1 | tr -d [:alpha:])
export JAVA_TO_BUILD=$(echo $1 | tr -d [:alpha:])
fi
checkJDK
shift;;
Expand Down Expand Up @@ -91,6 +91,7 @@ GIT_FORK="adoptopenjdk"
CLEAN_WORKSPACE=false
JDK_MAX=
JDK_GA=
export VARIANT=openj9

setJDKVars
processArgs $*
Expand All @@ -114,7 +115,7 @@ fi

if [[ "$(uname -m)" == "aarch64" && "$JAVA_TO_BUILD" == "jdk8u" && $VARIANT == "openj9" ]]; then
echo "Can't build OpenJ9 JDK8 on AARCH64, Resetting JAVA_TO_BUILD to jdk11u"
JAVA_TO_BUILD=jdk11u
export JAVA_TO_BUILD=jdk11u
fi

if [[ "$(uname -m)" == "armv7l" && "$VARIANT" == "openj9" ]]; then
Expand Down
20 changes: 11 additions & 9 deletions ansible/pbTestScripts/qemuPlaybookCheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ARCHITECTURE=""
OS=""
skipFullSetup=""
gitURL="https://github.com/adoptopenjdk/openjdk-infrastructure"
gitFork="adoptopenjdk"
gitBranch="master"
PORTNO=10022
if [ "$EXECUTOR_NUMBER" ]; then
Expand All @@ -13,7 +13,7 @@ current_dir=false
cleanWorkspace=false
retainVM=false
buildJDK=false
buildURL="https://github.com/adoptopenjdk/openjdk-build"
buildFork="adoptopenjdk"
buildBranch="master"
buildVariant=""
testJDK=false
Expand All @@ -30,8 +30,8 @@ processArgs() {
ARCHITECTURE="$1"; shift;;
"--build" | "-b" )
buildJDK=true;;
"--build-repo" | "-br" )
buildURL="$1"; shift;;
"--build-fork" | "-bf" )
buildFork="$1"; shift;;
"--build-branch" | "-bb" )
buildBranch="$1"; shift;;
"--build-hotspot" | "-hs" )
Expand All @@ -46,8 +46,8 @@ processArgs() {
retainVM=true;;
"--test" | "-t" )
testJDK=true;;
"--infra-repo" | "-ir" )
gitURL="$1"; shift;;
"--infra-fork" | "-if" )
gitFork="$1"; shift;;
"--infra-branch" | "-ib" )
gitBranch=$1; shift;;
"--skip-more" | "-sm" )
Expand All @@ -65,13 +65,13 @@ usage() {
echo "Usage: ./qemu_test_script.sh (<options>) -a <architecture> -o <os>
--architecture | -a Specifies the architecture to build the OS on
--build | -b Build a JDK on the qemu VM
--build-repo | -br Which openjdk-build to retrieve the build scripts from
--build-fork | -bf Which openjdk-build to retrieve the build scripts from
--build-branch | -bb Specify the branch of the build-repo (default: master)
--build-hotspot | -hs Build a JDK with a Hotspot JVM instead of an OpenJ9 one
--currentDir | -c Set Workspace to directory of this script
--clean-workspace | -cw Removes the old work folder (including logs)
--help | -h Shows this help message
--infra-repo | -ir Which openjdk-infrastructure to retrieve the playbooks (default: www.github.com/adoptopenjdk/openjdk-infrastructure)
--infra-fork | -if Which openjdk-infrastructure to retrieve the playbooks (default: adoptopenjdk)
--infra-branch | -ib Specify the branch of the infra-repo (default: master)
--jdk-version | -v Specify which JDK to build if '-b' is used (default: jdk8u)
--retainVM | -r Retain the VM once running the playbook
Expand Down Expand Up @@ -259,6 +259,7 @@ runPlaybook() {
local workFolder="$WORKSPACE"/qemu_pbCheck
local pbLogPath="$workFolder/logFiles/$OS.$ARCHITECTURE.log"
local extraAnsibleArgs=""
local gitURL="https://github.com/$gitFork/openjdk-infrastructure"

# RISCV requires this be specified
if [[ $ARCHITECTURE == "RISCV" ]]; then
Expand All @@ -281,8 +282,9 @@ runPlaybook() {

if [[ "$buildJDK" == true ]]; then
local buildLogPath="$workFolder/logFiles/$OS.$ARCHITECTURE.build_log"
local buildRepoArgs="-f $buildFork -b $buildBranch"

ssh linux@localhost -p "$PORTNO" -i "$workFolder"/id_rsa "git clone -b "$gitBranch" "$gitURL" \$HOME/openjdk-infrastructure && \$HOME/openjdk-infrastructure/ansible/pbTestScripts/buildJDK.sh --version $jdkToBuild $buildVariant --URL $buildURL/tree/$buildBranch" 2>&1 | tee "$buildLogPath"
ssh linux@localhost -p "$PORTNO" -i "$workFolder"/id_rsa "git clone -b "$gitBranch" "$gitURL" \$HOME/openjdk-infrastructure && \$HOME/openjdk-infrastructure/ansible/pbTestScripts/buildJDK.sh --version $jdkToBuild $buildVariant $buildRepoArgs" 2>&1 | tee "$buildLogPath"
if grep -q '] Error' "$buildLogPath" || grep -q 'configure: error' "$buildLogPath"; then
echo BUILD FAILED
destroyVM
Expand Down