Skip to content

Commit

Permalink
pbTests: Update Vagrantfile paths in VPC/vmDestroy
Browse files Browse the repository at this point in the history
  • Loading branch information
Willsparker committed Jun 15, 2021
1 parent e8d0c0c commit eca4861
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ansible/pbTestScripts/vagrantPlaybookCheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ checkVars()
if [ "$vagrantOS" == "" ]; then
usage
echo "ERROR: No Vagrant OS specified - Use -h for help, -a for all or -v with one of the following:"
ls -1 ../Vagrantfile.* | cut -d. -f4
ls -1 ../vagrant/Vagrantfile.* | cut -d. -f4
exit 1
fi
if [[ "$runTest" == true && "$testNativeBuild" == false ]]; then
Expand Down Expand Up @@ -143,9 +143,9 @@ checkVagrantOS()
{
local vagrantOSList
if [[ "$newVagrantFiles" = "true" ]]; then
cd ${WORKSPACE}/adoptopenjdkPBTests/${gitFork}-${gitBranch}/ansible
cd ${WORKSPACE}/adoptopenjdkPBTests/${gitFork}-${gitBranch}/ansible/vagrant
else
cd ${scriptPath%/*}/..
cd ${scriptPath%/*}/../vagrant
fi
vagrantOSList=$(ls -1 Vagrantfile.* | cut -d. -f 2)
if [[ -f "Vagrantfile.${vagrantOS}" ]]; then
Expand Down
9 changes: 7 additions & 2 deletions ansible/pbTestScripts/vmDestroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ listOS() {

destroyVMs() {
local OS=$1
vagrant global-status --prune | awk "/adoptopenjdk$OS/ { print \$1 }" | xargs vagrant destroy -f
echo "Destroyed all $OS Vagrant VMs"
local ID=$(vagrant global-status --prune | awk "/adoptopenjdk$OS/ { print \$1 }")
if [[ $ID != "" ]]; then
vagrant destroy -f $ID
echo "Destroyed all $OS vagrant VMs"
else
echo "No $1 vagrant VMs, moving on..."
fi
}

processArgs $*
Expand Down

0 comments on commit eca4861

Please sign in to comment.