From 3d75de8344a9d7cf8ecd621dfa31b8a6690e2461 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Mon, 30 Nov 2015 14:38:54 -0500 Subject: [PATCH 1/4] By default clean up; previously some jobs didn't. --- build.yaml | 18 ++---------------- jobs.groovy.j2 | 6 +++--- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/build.yaml b/build.yaml index 35dd430f7d..d654cbcbf1 100644 --- a/build.yaml +++ b/build.yaml @@ -764,7 +764,7 @@ common_cli: # Toggles: # * archive_artifacts: ( define if there are files to be archived) # * coverage_report: ( enable if this job produces a coverage report file) -# * clean_repo: (enable if we need to clean old files owned by root) +# * dont_clean_repo: (enable if we don't want to delete old files owned by root) # # run_trial_modules contains a list of all the modules we want to execute @@ -852,7 +852,6 @@ job_type: archive_artifacts: *flocker_artifacts publish_test_results: true coverage_report: true - clean_repo: true timeout: 30 run_trial_on_AWS_CentOS_7_as_root: @@ -864,7 +863,6 @@ job_type: archive_artifacts: *flocker_artifacts publish_test_results: true coverage_report: true - clean_repo: true timeout: 30 # http://build.clusterhq.com/builders/flocker-admin @@ -877,7 +875,6 @@ job_type: archive_artifacts: *flocker_artifacts publish_test_results: true coverage_report: true - clean_repo: true timeout: 30 run_trial_on_AWS_Ubuntu_Trusty_as_root: @@ -889,7 +886,6 @@ job_type: archive_artifacts: *flocker_artifacts publish_test_results: true coverage_report: true - clean_repo: true timeout: 30 @@ -909,7 +905,6 @@ job_type: } archive_artifacts: *flocker_artifacts coverage_report: true - clean_repo: true timeout: 45 run_trial_for_ebs_storage_driver_on_Ubuntu_trusty: @@ -928,7 +923,6 @@ job_type: archive_artifacts: *flocker_artifacts publish_test_results: true coverage_report: true - clean_repo: true timeout: 45 @@ -948,7 +942,6 @@ job_type: archive_artifacts: *flocker_artifacts publish_test_results: true coverage_report: true - clean_repo: true timeout: 45 run_trial_for_cinder_storage_driver_on_Ubuntu_trusty: @@ -967,7 +960,6 @@ job_type: archive_artifacts: *flocker_artifacts publish_test_results: true coverage_report: true - clean_repo: true timeout: 45 @@ -1005,7 +997,6 @@ job_type: *clean_packages, *exit_with_return_code_from_test ] } - clean_repo: true archive_artifacts: *acceptance_tests_artifacts timeout: 45 run_acceptance_on_AWS_Ubuntu_Trusty_for: @@ -1025,7 +1016,6 @@ job_type: *clean_packages, *exit_with_return_code_from_test ] } - clean_repo: true archive_artifacts: *acceptance_tests_artifacts_ubuntu_special_case timeout: 45 run_acceptance_on_Rackspace_CentOS_7_for: @@ -1047,7 +1037,6 @@ job_type: *clean_packages, *exit_with_return_code_from_test ] } - clean_repo: true archive_artifacts: *acceptance_tests_artifacts timeout: 45 run_acceptance_on_Rackspace_Ubuntu_Trusty_for: @@ -1069,7 +1058,6 @@ job_type: *clean_packages, *exit_with_return_code_from_test ] } - clean_repo: true archive_artifacts: *acceptance_tests_artifacts_ubuntu_special_case timeout: 45 @@ -1089,7 +1077,6 @@ job_type: *clean_packages, *exit_with_return_code_from_test ] } - clean_repo: true timeout: 30 run_client_installation_on_Ubuntu_Vivid: on_nodes_with_labels: 'aws-ubuntu-trusty-T2Medium' @@ -1105,7 +1092,6 @@ job_type: *clean_packages, *exit_with_return_code_from_test ] } - clean_repo: true timeout: 30 run_client_installation_on_OSX: on_nodes_with_labels: 'mesos-1GB' @@ -1138,7 +1124,7 @@ job_type: *run_build_sh_script_on_vagrant_box, *destroy_vagrant_box] } - clean_repo: false + dont_clean_repo: true timeout: 30 diff --git a/jobs.groovy.j2 b/jobs.groovy.j2 index 828b457795..82198759d6 100644 --- a/jobs.groovy.j2 +++ b/jobs.groovy.j2 @@ -179,9 +179,9 @@ listView("${dashProject}/${dashBranchName}/{{name}}") { the priviledges to remove the root owned files created by the sudo tests. To fix this issue, we use a preSCM plugin which allows us to execute a step before cloning/checking the git reposity. - if the build.yaml contains a 'clean_repo' flag, then we will clean up - old root files from the repo. #} -{% if v.clean_repo %} + if the build.yaml contains a 'dont_clean_repo' flag, then we won't clean + up old root files from the repo #} +{% if v.dont_clean_repo is not defined or not v.dont_clean_repo %} preScmSteps { steps { shell("sudo rm -rf {{ directory_to_delete }}") From c5a9ba49bede4f3bb87fa77939535fb98b7ad407 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Tue, 1 Dec 2015 08:28:00 -0500 Subject: [PATCH 2/4] Maybe cleaning up is fine? --- build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/build.yaml b/build.yaml index d654cbcbf1..bd1ff4a651 100644 --- a/build.yaml +++ b/build.yaml @@ -1124,7 +1124,6 @@ job_type: *run_build_sh_script_on_vagrant_box, *destroy_vagrant_box] } - dont_clean_repo: true timeout: 30 From 2778dd1154ed547025ce7159bb3edcdb298935fc Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Tue, 1 Dec 2015 10:33:33 -0500 Subject: [PATCH 3/4] Add output indicating deletion happened. --- jobs.groovy.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/jobs.groovy.j2 b/jobs.groovy.j2 index 82198759d6..ef58e7c450 100644 --- a/jobs.groovy.j2 +++ b/jobs.groovy.j2 @@ -185,6 +185,7 @@ listView("${dashProject}/${dashBranchName}/{{name}}") { preScmSteps { steps { shell("sudo rm -rf {{ directory_to_delete }}") + println("Deleted directory {{ directory_to_delete }}") } } {% endif %} From 00e1e8b76cd7533b682a6fc6c3988c64396d8d87 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Tue, 1 Dec 2015 12:42:06 -0500 Subject: [PATCH 4/4] Better printing method. --- jobs.groovy.j2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jobs.groovy.j2 b/jobs.groovy.j2 index ef58e7c450..d43c7da21e 100644 --- a/jobs.groovy.j2 +++ b/jobs.groovy.j2 @@ -184,8 +184,10 @@ listView("${dashProject}/${dashBranchName}/{{name}}") { {% if v.dont_clean_repo is not defined or not v.dont_clean_repo %} preScmSteps { steps { - shell("sudo rm -rf {{ directory_to_delete }}") - println("Deleted directory {{ directory_to_delete }}") + shell(""" +sudo rm -rf {{ directory_to_delete }} +echo 'Deleted directory {{ directory_to_delete }}' +""") } } {% endif %}