From b18650fed6c50035fd0a19aadde123085bb8a40b Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Thu, 8 Sep 2016 09:32:14 -0400 Subject: [PATCH 01/23] Change over to md5sum to support centos as primary for builds and notifications. --- bin/perms.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/perms.sh b/bin/perms.sh index 0b378a6..0d2f79d 100755 --- a/bin/perms.sh +++ b/bin/perms.sh @@ -10,14 +10,14 @@ aws s3api put-object-acl --bucket $bucket --key $vagrant_key --acl public-read echo "(https://s3-us-west-1.amazonaws.com/$bucket/$vagrant_key)" -echo $(md5 builds/$vagrant_key) +echo $(md5sum builds/$vagrant_key) echo "Found $ova_key" aws s3api put-object-acl --bucket $bucket --key $ova_key --acl public-read echo "(https://s3-us-west-1.amazonaws.com/$bucket/$ova_key)" -echo $(md5 builds/$ova_key) +echo $(md5sum builds/$ova_key) ami_id=$(aws ec2 describe-images --owners $aws_acct_id --query 'reverse(sort_by(Images[?starts_with(Name, `import-ami`)], &CreationDate))[0].[ImageId]' --output text | tr -d '\n' ) echo "Publishing $ami_id to $aws_acct_id" From 7870333f86dc6b02a78d8e0f6c85170675cd9a09 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Mon, 12 Sep 2016 10:50:19 -0400 Subject: [PATCH 02/23] Increase VM disk size. --- grouper-appliance.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grouper-appliance.json b/grouper-appliance.json index bd84099..e4418e4 100644 --- a/grouper-appliance.json +++ b/grouper-appliance.json @@ -3,7 +3,7 @@ "description": "Grouper appliance ", "variables": { "profile": "xfs", - "disk_size": "8192", + "disk_size": "20000", "memory": "2048", "cpus": "1", "guest_os_type": "RedHat_64", From 4dba977775af26cc67413ff5812322a0d81744b5 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Mon, 12 Sep 2016 14:00:21 -0400 Subject: [PATCH 03/23] Increase vm disk size. --- comanage-appliance.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comanage-appliance.json b/comanage-appliance.json index a61d24d..28a30cc 100644 --- a/comanage-appliance.json +++ b/comanage-appliance.json @@ -3,7 +3,7 @@ "description": "Comanage appliance ", "variables": { "profile": "xfs", - "disk_size": "8192", + "disk_size": "20000", "memory": "6122", "cpus": "2", "ssh_username": "centos", From 6011a309657c47085cb6445c2ea164e830df7890 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Tue, 13 Sep 2016 09:39:08 -0400 Subject: [PATCH 04/23] Add ami description info for perms / slack notification. --- bin/perms.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/perms.sh b/bin/perms.sh index 0b378a6..9ce6c23 100755 --- a/bin/perms.sh +++ b/bin/perms.sh @@ -22,5 +22,8 @@ echo $(md5 builds/$ova_key) ami_id=$(aws ec2 describe-images --owners $aws_acct_id --query 'reverse(sort_by(Images[?starts_with(Name, `import-ami`)], &CreationDate))[0].[ImageId]' --output text | tr -d '\n' ) echo "Publishing $ami_id to $aws_acct_id" +ami_image_description=$(aws ec2 describe-images --image-ids $ami_id --query 'Images[0].{Description:Tags[0].Value}') +echo $ami_image_description + aws ec2 modify-image-attribute --image-id $ami_id --launch-permission "{\"Add\":[{\"UserId\":\"$aws_acct_id\"}]}" From b0b77eaa248cf936cd1c6436b71a7641ac34976e Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Tue, 13 Sep 2016 11:40:30 -0400 Subject: [PATCH 05/23] Increase vm disk size for shibboleth appliance. --- shibboleth-appliance.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shibboleth-appliance.json b/shibboleth-appliance.json index 13777c1..e3cccf9 100644 --- a/shibboleth-appliance.json +++ b/shibboleth-appliance.json @@ -3,7 +3,7 @@ "description": "Shibboleth appliance ", "variables": { "profile": "xfs", - "disk_size": "8192", + "disk_size": "20000", "memory": "2048", "cpus": "1", "guest_os_type": "RedHat_64", From f5d51d0d2be0593cce16a3d21b699aeebeab5003 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 13:00:34 -0400 Subject: [PATCH 06/23] Help ensure that the cleanup stage for Jenkins pipeline is more flexible regarding user directory cleanup. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3eb29a1..fc9c6c2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ def performBuild(String project){ try { stage 'Cleanup & Setup' sh "rm -rf output-${project}-*" - sh "rm -rf \"/Users/levvel/VirtualBox VMs/${project}-appliance-*\"" + sh "rm -rf \"~/VirtualBox VMs/${project}-appliance-*\"" sh 'rm -rf builds' sh 'mkdir -p builds' From 41c4b093834bf4c220acec955fa310428dfd1336 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 14:38:02 -0400 Subject: [PATCH 07/23] Doubling up the removal of any lingering or failed Virtual VMs. --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fc9c6c2..6f156a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,8 @@ def performBuild(String project){ try { stage 'Cleanup & Setup' sh "rm -rf output-${project}-*" - sh "rm -rf \"~/VirtualBox VMs/${project}-appliance-*\"" + sh "rm -rf \"/Users/levvel/VirtualBox VMs/${project}-appliance-*\"" + sh "rm -rf \"/home/centos/VirtualBox VMs/${project}-appliance-*\"" sh 'rm -rf builds' sh 'mkdir -p builds' From 4b2cd2b18b35512865cd02294bfd174013c061f8 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 14:48:58 -0400 Subject: [PATCH 08/23] Change cleanup for VirtualBox Vms in the jenkins pipeline. --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f156a2..5028c85 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,8 +24,7 @@ def performBuild(String project){ try { stage 'Cleanup & Setup' sh "rm -rf output-${project}-*" - sh "rm -rf \"/Users/levvel/VirtualBox VMs/${project}-appliance-*\"" - sh "rm -rf \"/home/centos/VirtualBox VMs/${project}-appliance-*\"" + sh "rm -rf ~/VirtualBox\ VMs/${project}-appliance-*" sh 'rm -rf builds' sh 'mkdir -p builds' From a8dc8c17931e7e4c306841ba4547be05b473d1ae Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 14:51:14 -0400 Subject: [PATCH 09/23] Change cleanup for VirtualBox Vms in the jenkins pipeline. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5028c85..01c0b80 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ def performBuild(String project){ try { stage 'Cleanup & Setup' sh "rm -rf output-${project}-*" - sh "rm -rf ~/VirtualBox\ VMs/${project}-appliance-*" + sh "rm -rf '~/VirtualBox VMs/${project}-appliance-*'" sh 'rm -rf builds' sh 'mkdir -p builds' From 25030b824c480779768a4bbefa1aaf693e851d7f Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 15:17:09 -0400 Subject: [PATCH 10/23] Add in workspace debug --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 01c0b80..71e4c99 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,6 +7,7 @@ node('packer') { stage 'Appliance build' echo "My Branch is: ${env.BRANCH_NAME}" + echo "My Workspace is: ${WORKSPACE}" BRANCH_TEST = "${env.BRANCH_NAME}" From 663c194568d56689dde557a8c467c95ff6bea5af Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 15:20:28 -0400 Subject: [PATCH 11/23] Add in workspace debug --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 71e4c99..f1fbcb6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,7 @@ node('packer') { stage 'Appliance build' echo "My Branch is: ${env.BRANCH_NAME}" - echo "My Workspace is: ${WORKSPACE}" + echo "My Workspace is: ${env.WORKSPACE}" BRANCH_TEST = "${env.BRANCH_NAME}" From 83c542e967f0572e755b35df0b7c27f5a1da7a31 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 15:23:23 -0400 Subject: [PATCH 12/23] Remove in workspace debug --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f1fbcb6..01c0b80 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,6 @@ node('packer') { stage 'Appliance build' echo "My Branch is: ${env.BRANCH_NAME}" - echo "My Workspace is: ${env.WORKSPACE}" BRANCH_TEST = "${env.BRANCH_NAME}" From 0ed7198dd8c12979ae805a92cb451a29566e3e7a Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 16:08:30 -0400 Subject: [PATCH 13/23] Adjust VirtualBox VMs directory removal. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 01c0b80..551944c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ def performBuild(String project){ try { stage 'Cleanup & Setup' sh "rm -rf output-${project}-*" - sh "rm -rf '~/VirtualBox VMs/${project}-appliance-*'" + sh "rm -rf '/Users/levvel/VirtualBox VMs/${project}-appliance-centos7-xfs'" sh 'rm -rf builds' sh 'mkdir -p builds' From 488e34fee9cc9c9bbe318dd179519cdfa5e3da3f Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 16:19:14 -0400 Subject: [PATCH 14/23] Utilize remove scripts for jenkins pipeline cleanup. --- Jenkinsfile | 2 +- bin/remove-comanage.sh | 4 ++++ bin/remove-grouper.sh | 4 ++++ bin/remove-shibboleth.sh | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 bin/remove-comanage.sh create mode 100644 bin/remove-grouper.sh create mode 100644 bin/remove-shibboleth.sh diff --git a/Jenkinsfile b/Jenkinsfile index 551944c..9cbcfff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ def performBuild(String project){ try { stage 'Cleanup & Setup' sh "rm -rf output-${project}-*" - sh "rm -rf '/Users/levvel/VirtualBox VMs/${project}-appliance-centos7-xfs'" + sh "bin/remove-${project}.sh" sh 'rm -rf builds' sh 'mkdir -p builds' diff --git a/bin/remove-comanage.sh b/bin/remove-comanage.sh new file mode 100644 index 0000000..bb2f800 --- /dev/null +++ b/bin/remove-comanage.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +rm -rf /Users/levvel/VirtualBox\ VMs/comanage-appliance-centos7-xfs/ +rm -rf /home/centos/VirtualBox\ VMs/comanage-appliance-centos7-xfs/ diff --git a/bin/remove-grouper.sh b/bin/remove-grouper.sh new file mode 100644 index 0000000..7216b65 --- /dev/null +++ b/bin/remove-grouper.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +rm -rf /Users/levvel/VirtualBox\ VMs/grouper-appliance-centos7-xfs/ +rm -rf /home/centos/VirtualBox\ VMs/grouper-appliance-centos7-xfs/ diff --git a/bin/remove-shibboleth.sh b/bin/remove-shibboleth.sh new file mode 100644 index 0000000..1b658f8 --- /dev/null +++ b/bin/remove-shibboleth.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +rm -rf /Users/levvel/VirtualBox\ VMs/shibboleth-appliance-centos7-xfs/ +rm -rf /home/centos/VirtualBox\ VMs/shibboleth-appliance-centos7-xfs/ From 89dadf5cecad398dfd69c914a85a21439473aa9e Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 16:21:28 -0400 Subject: [PATCH 15/23] Setup perms for remove scripts. --- bin/remove-comanage.sh | 0 bin/remove-grouper.sh | 0 bin/remove-shibboleth.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bin/remove-comanage.sh mode change 100644 => 100755 bin/remove-grouper.sh mode change 100644 => 100755 bin/remove-shibboleth.sh diff --git a/bin/remove-comanage.sh b/bin/remove-comanage.sh old mode 100644 new mode 100755 diff --git a/bin/remove-grouper.sh b/bin/remove-grouper.sh old mode 100644 new mode 100755 diff --git a/bin/remove-shibboleth.sh b/bin/remove-shibboleth.sh old mode 100644 new mode 100755 From 0956c4b000495db798cf531965e22cbca85bc407 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 16:24:34 -0400 Subject: [PATCH 16/23] Help ensure cleanup on errors. --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 9cbcfff..8e683d3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -84,5 +84,8 @@ def handleError(String message){ currentBuild.setResult("FAILED") slackSend color: 'danger', message: "${message}" //step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'chris.bynum@levvel.io', sendToIndividuals: true]) + + sh "bin/remove-${project}.sh" + sh 'exit 1' } From bde6559b0dcf154a2d42cce976cf8a9e8953c188 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 16:30:00 -0400 Subject: [PATCH 17/23] Help ensure cleanup on errors. --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8e683d3..176f449 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -75,11 +75,11 @@ def performBuild(String project){ } catch (err) { - handleError("BUILD ERROR: There was a problem with ${project} Appliance. ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL} |Open>) \n\n ${err}") + handleError("BUILD ERROR: There was a problem with ${project} Appliance. ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL} |Open>) \n\n ${err}", ${project}) } } -def handleError(String message){ +def handleError(String message, string project){ echo "${message}" currentBuild.setResult("FAILED") slackSend color: 'danger', message: "${message}" From 1aef07a7704b96168d3fc14db7ab9be9c10cc958 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 16:30:46 -0400 Subject: [PATCH 18/23] Help ensure cleanup on errors. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 176f449..9af2a40 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -79,7 +79,7 @@ def performBuild(String project){ } } -def handleError(String message, string project){ +def handleError(String message, String project){ echo "${message}" currentBuild.setResult("FAILED") slackSend color: 'danger', message: "${message}" From de7c98f98d99104fcbe09a81437be2f5441a9537 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 16:44:01 -0400 Subject: [PATCH 19/23] Refactor for user home directory. --- bin/remove-comanage.sh | 3 +-- bin/remove-grouper.sh | 3 +-- bin/remove-shibboleth.sh | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/bin/remove-comanage.sh b/bin/remove-comanage.sh index bb2f800..21bbc93 100755 --- a/bin/remove-comanage.sh +++ b/bin/remove-comanage.sh @@ -1,4 +1,3 @@ #!/bin/bash -rm -rf /Users/levvel/VirtualBox\ VMs/comanage-appliance-centos7-xfs/ -rm -rf /home/centos/VirtualBox\ VMs/comanage-appliance-centos7-xfs/ +rm -rf $USER/VirtualBox\ VMs/comanage-appliance-centos7-xfs/ diff --git a/bin/remove-grouper.sh b/bin/remove-grouper.sh index 7216b65..dbbf98a 100755 --- a/bin/remove-grouper.sh +++ b/bin/remove-grouper.sh @@ -1,4 +1,3 @@ #!/bin/bash -rm -rf /Users/levvel/VirtualBox\ VMs/grouper-appliance-centos7-xfs/ -rm -rf /home/centos/VirtualBox\ VMs/grouper-appliance-centos7-xfs/ +rm -rf $USER/VirtualBox\ VMs/grouper-appliance-centos7-xfs/ diff --git a/bin/remove-shibboleth.sh b/bin/remove-shibboleth.sh index 1b658f8..e9940ca 100755 --- a/bin/remove-shibboleth.sh +++ b/bin/remove-shibboleth.sh @@ -1,4 +1,3 @@ #!/bin/bash -rm -rf /Users/levvel/VirtualBox\ VMs/shibboleth-appliance-centos7-xfs/ -rm -rf /home/centos/VirtualBox\ VMs/shibboleth-appliance-centos7-xfs/ +rm -rf $USER/VirtualBox\ VMs/shibboleth-appliance-centos7-xfs/ From eb373828b6bd15da674708f2cc7f8501b0d0e962 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 16:49:10 -0400 Subject: [PATCH 20/23] Change out cleanup on error. --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9af2a40..8b6b73d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -75,17 +75,15 @@ def performBuild(String project){ } catch (err) { - handleError("BUILD ERROR: There was a problem with ${project} Appliance. ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL} |Open>) \n\n ${err}", ${project}) + handleError("BUILD ERROR: There was a problem with ${project} Appliance. ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL} |Open>) \n\n ${err}") } } -def handleError(String message, String project){ +def handleError(String message){ echo "${message}" currentBuild.setResult("FAILED") slackSend color: 'danger', message: "${message}" //step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'chris.bynum@levvel.io', sendToIndividuals: true]) - sh "bin/remove-${project}.sh" - sh 'exit 1' } From 5be87c4c9c7d9af48faf6db4f471a568d6588653 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 18:02:41 -0400 Subject: [PATCH 21/23] Revise user home directory interpolation. --- bin/remove-comanage.sh | 2 +- bin/remove-grouper.sh | 2 +- bin/remove-shibboleth.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/remove-comanage.sh b/bin/remove-comanage.sh index 21bbc93..1401355 100755 --- a/bin/remove-comanage.sh +++ b/bin/remove-comanage.sh @@ -1,3 +1,3 @@ #!/bin/bash -rm -rf $USER/VirtualBox\ VMs/comanage-appliance-centos7-xfs/ +rm -rf ~/VirtualBox\ VMs/comanage-appliance-centos7-xfs/ diff --git a/bin/remove-grouper.sh b/bin/remove-grouper.sh index dbbf98a..00f8d2b 100755 --- a/bin/remove-grouper.sh +++ b/bin/remove-grouper.sh @@ -1,3 +1,3 @@ #!/bin/bash -rm -rf $USER/VirtualBox\ VMs/grouper-appliance-centos7-xfs/ +rm -rf ~/VirtualBox\ VMs/grouper-appliance-centos7-xfs/ diff --git a/bin/remove-shibboleth.sh b/bin/remove-shibboleth.sh index e9940ca..40fc06b 100755 --- a/bin/remove-shibboleth.sh +++ b/bin/remove-shibboleth.sh @@ -1,3 +1,3 @@ #!/bin/bash -rm -rf $USER/VirtualBox\ VMs/shibboleth-appliance-centos7-xfs/ +rm -rf ~/VirtualBox\ VMs/shibboleth-appliance-centos7-xfs/ From 9d078c06d6f72eb8d26b062ecf4dccce99a6e35e Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 18:11:50 -0400 Subject: [PATCH 22/23] Revise user home directory interpolation. --- bin/remove-comanage.sh | 2 +- bin/remove-grouper.sh | 2 +- bin/remove-shibboleth.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/remove-comanage.sh b/bin/remove-comanage.sh index 1401355..e56368b 100755 --- a/bin/remove-comanage.sh +++ b/bin/remove-comanage.sh @@ -1,3 +1,3 @@ #!/bin/bash -rm -rf ~/VirtualBox\ VMs/comanage-appliance-centos7-xfs/ +rm -rf $HOME/VirtualBox\ VMs/comanage-appliance-centos7-xfs/ diff --git a/bin/remove-grouper.sh b/bin/remove-grouper.sh index 00f8d2b..4bbf6da 100755 --- a/bin/remove-grouper.sh +++ b/bin/remove-grouper.sh @@ -1,3 +1,3 @@ #!/bin/bash -rm -rf ~/VirtualBox\ VMs/grouper-appliance-centos7-xfs/ +rm -rf $HOME/VirtualBox\ VMs/grouper-appliance-centos7-xfs/ diff --git a/bin/remove-shibboleth.sh b/bin/remove-shibboleth.sh index 40fc06b..a106560 100755 --- a/bin/remove-shibboleth.sh +++ b/bin/remove-shibboleth.sh @@ -1,3 +1,3 @@ #!/bin/bash -rm -rf ~/VirtualBox\ VMs/shibboleth-appliance-centos7-xfs/ +rm -rf $HOME/VirtualBox\ VMs/shibboleth-appliance-centos7-xfs/ From 097561b765a5c275aaa34cbbb13827fdf799dde6 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Wed, 14 Sep 2016 19:01:48 -0400 Subject: [PATCH 23/23] Add Virtualbox cleanup to error handling. --- Jenkinsfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8b6b73d..3725dc4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -75,15 +75,19 @@ def performBuild(String project){ } catch (err) { - handleError("BUILD ERROR: There was a problem with ${project} Appliance. ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL} |Open>) \n\n ${err}") + handleError("BUILD ERROR: There was a problem with ${project} Appliance. ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL} |Open>) \n\n ${err}", "${project}-appliance-centos7-xfs") } } -def handleError(String message){ +def handleError(String message, String appliance_name){ echo "${message}" currentBuild.setResult("FAILED") slackSend color: 'danger', message: "${message}" //step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'chris.bynum@levvel.io', sendToIndividuals: true]) + sh "VBoxManage controlvm ${appliance_name} poweroff" + + sh "VboxManage unregistervm ${appliance_name} --delete" + sh 'exit 1' }