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

Modified testScript.sh to allow for Win2012 to build JDK #942

Merged
merged 11 commits into from
Oct 30, 2019
9 changes: 9 additions & 0 deletions ansible/pbTestScripts/buildJDKWin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -eu
export TARGET_OS=windows
export ARCHITECTURE=x64
export JAVA_TO_BUILD=jdk8
export VARIANT=hotspot
export JDK7_BOOT_DIR=/cygdrive/c/openjdk/jdk7
export PATH=/usr/bin/:$PATH
/cygdrive/c/openjdk-build/makejdk-any-platform.sh -J /cygdrive/c/openjdk/jdk-8 --configure-args "--disable-ccache --with-toolchain-version=2013" --freetype-version 2.5.3 -v jdk8u
14 changes: 13 additions & 1 deletion ansible/pbTestScripts/testScript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ testBuild()
vagrant ssh -c "cd /vagrant/pbTestScripts && ./buildJDK.sh"
}

testBuildWin()
{
# Ensures the git config won't change line endings
vagrant powershell -c "Start-Process powershell -Verb runAs; C:/cygwin64/bin/sed -i -e 's/autocrlf.*/autocrlf = false/g' C:\\ProgramData/Git/config"
# Run the build role of the Playbook
cd $WORKSPACE/adoptopenjdkPBTests/$folderName-$branchName/ansible && ansible-playbook -i playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win -u vagrant --tags build playbooks/AdoptOpenJDK_Windows_Playbook/main.yml
}

# Takes the OS as arg 1
startVMPlaybook()
{
Expand Down Expand Up @@ -197,7 +205,11 @@ startVMPlaybookWin()
vagrant powershell -c "Start-Process powershell -Verb runAs; \$size = (Get-PartitionSupportedSize -DriveLetter c); Resize-Partition -DriveLetter c -Size \$size.SizeMax"
fi
# run the ansible playbook on the VM & logs the output.
ansible-playbook -i playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win -u vagrant --skip-tags jenkins,adoptopenjdk playbooks/AdoptOpenJDK_Windows_Playbook/main.yml 2>&1 | tee $WORKSPACE/adoptopenjdkPBTests/logFiles/$folderName.$branchName.$OS.log
ansible-playbook -i playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win -u vagrant --skip-tags jenkins,adoptopenjdk,build playbooks/AdoptOpenJDK_Windows_Playbook/main.yml 2>&1 | tee $WORKSPACE/adoptopenjdkPBTests/logFiles/$folderName.$branchName.$OS.log
if [[ "$testNativeBuild" = true ]]; then
testBuildWin
fi
vagrant halt
}

destroyVM()
Expand Down
1 change: 1 addition & 0 deletions ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@
- nasm # OpenJ9
- Rust # IcedTea-Web
- IcedTea-Web # For Jenkins webstart
- Build # Role to build JDK8
karianna marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
################
# Build JDK8 #
################
- name: check if openjdk-build repo exists
win_stat:
path: 'C:\openjdk-build'
register: build_repo_exists
tags: build

- name: check if a JDK8 has been built previously
win_stat:
path: 'C:\workspace\build\src\build\'
register: previous_JDK_build
tags: build

- name: git clone openjdk-build repo
raw: cd C:/; git clone https://github.com/adoptopenjdk/openjdk-build
when: (build_repo_exists.stat.exists == false)
tags: build

- name: Start build Script
raw: Start-Process powershell.exe -Verb runAs; cd C:/; sh C:/vagrant/pbTestScripts/buildJDKWin.sh
when: (previous_JDK_build.stat.exists == false)
register: build_script
tags: build