-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stewart X Addison <[email protected]>
- Loading branch information
Showing
1 changed file
with
14 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,8 +221,14 @@ startVMPlaybook() | |
ln -sf ${scriptPath%/*}/../vagrant/Vagrantfile.$OS Vagrantfile | ||
fi | ||
# Copy the machine's ssh key for the VMs to use, after removing prior files | ||
rm -f id_rsa.pub id_rsa | ||
ssh-keygen -q -f $PWD/id_rsa -t rsa -N '' | ||
if [ "$OS" = "Ubuntu2204" ]; then | ||
sshKeyType=ed25519 | ||
else | ||
sshKeyType=rsa | ||
fi | ||
sshKeyFile=id_${sshKeyType} | ||
rm -f ${sshKeyFile} ${sshKeyFile}.pub | ||
ssh-keygen -q -f $PWD/${sshKeyFile} -t ${sshKeyType} -N '' | ||
|
||
# The BUILD_ID variable is required to stop Jenkins shutting down the wrong VMS | ||
# See https://github.com/adoptium/infrastructure/issues/1287#issuecomment-625142917 | ||
|
@@ -237,7 +243,7 @@ startVMPlaybook() | |
ssh-keygen -R $(cat playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx) | ||
|
||
sed -i -e "s/.*hosts:.*/ hosts: all/g" playbooks/AdoptOpenJDK_Unix_Playbook/main.yml | ||
awk '{print}/^\[defaults\]$/{print "private_key_file = id_rsa"; print "remote_tmp = $HOME/.ansible/tmp"; print "timeout = 60"}' < ansible.cfg > ansible.cfg.tmp && mv ansible.cfg.tmp ansible.cfg | ||
awk '{print}/^\[defaults\]$/{print "private_key_file = id_ed25519"; print "remote_tmp = $HOME/.ansible/tmp"; print "timeout = 60"}' < ansible.cfg > ansible.cfg.tmp && mv ansible.cfg.tmp ansible.cfg | ||
|
||
ansible-playbook $verbosity -i playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx -u vagrant -b --skip-tags adoptopenjdk,jenkins${skipFullSetup} playbooks/AdoptOpenJDK_Unix_Playbook/main.yml 2>&1 | tee $WORKSPACE/adoptopenjdkPBTests/logFiles/$gitFork.$newGitBranch.$OS.log | ||
echo The playbook finished at : `date +%T` | ||
|
@@ -256,7 +262,7 @@ startVMPlaybook() | |
if [[ "$testNativeBuild" = true ]]; then | ||
local buildLogPath="$WORKSPACE/adoptopenjdkPBTests/logFiles/${gitFork}.${newGitBranch}.$OS.build_log" | ||
|
||
ssh -p ${vagrantPORT} $ssh_args -i $PWD/id_rsa [email protected] "cd /vagrant/pbTestScripts && bash buildJDK.sh $buildBranch $buildFork $jdkToBuild $buildHotspot" 2>&1 | tee $buildLogPath | ||
ssh -p ${vagrantPORT} $ssh_args -i $PWD/${sshKeyFile} [email protected] "cd /vagrant/pbTestScripts && bash buildJDK.sh $buildBranch $buildFork $jdkToBuild $buildHotspot" 2>&1 | tee $buildLogPath | ||
echo The build finished at : `date +%T` | ||
if grep -q '] Error' $buildLogPath || grep -q 'configure: error' $buildLogPath; then | ||
echo BUILD FAILED | ||
|
@@ -265,7 +271,7 @@ startVMPlaybook() | |
|
||
if [[ "$runTest" = true ]]; then | ||
local testLogPath="$WORKSPACE/adoptopenjdkPBTests/logFiles/${gitFork}.${newGitBranch}.$OS.test_log" | ||
ssh -p ${vagrantPORT} $ssh_args -i $PWD/id_rsa [email protected] "cd /vagrant/pbTestScripts && bash testJDK.sh" 2>&1 | tee $testLogPath | ||
ssh -p ${vagrantPORT} $ssh_args -i $PWD/${sshKeyFile} [email protected] "cd /vagrant/pbTestScripts && bash testJDK.sh" 2>&1 | tee $testLogPath | ||
echo The test finished at : `date +%T` | ||
if ! grep -q 'FAILED: 0' $testLogPath; then | ||
echo TEST FAILED | ||
|
@@ -278,11 +284,11 @@ startVMPlaybook() | |
if [ "$OS" == "FreeBSD12" -o "$OS" == "CentOS8" -o "$OS" == "CentOS6" ]; then | ||
echo Skipping docker test as we do not set it up on $OS | ||
else | ||
# if ! ssh -p ${vagrantPORT} -i $PWD/id_rsa [email protected] /usr/sbin/service docker status; then | ||
# if ! ssh -p ${vagrantPORT} -i $PWD/${sshKeyFile} [email protected] /usr/sbin/service docker status; then | ||
# echo WARNING: Docker service was not started on the VM ... Attempting to start | ||
# ssh -p ${vagrantPORT} -i $PWD/id_rsa [email protected] /usr/sbin/service docker start | ||
# ssh -p ${vagrantPORT} -i $PWD/${sshKeyFile} [email protected] /usr/sbin/service docker start | ||
# fi | ||
ssh -p ${vagrantPORT} -i $PWD/id_rsa [email protected] sudo docker run alpine /bin/echo Hello World from inside docker | ||
ssh -p ${vagrantPORT} -i $PWD/${sshKeyFile} [email protected] sudo docker run alpine /bin/echo Hello World from inside docker | ||
echo The docker validation finished at : `date +%T` | ||
fi | ||
fi | ||
|