Revert "Rollback to deprecated "logrotate" JJB option"

This reverts commit df65588462d9dcb394c6dad6f23e968d0fba0679.

Reason for revert: to be re-done

Change-Id: I69bd703b7e175ced7d9a53cf7339116fc560bea8
diff --git a/jobs/templates/2019.2.0-heat-cicd-pike-dvr-sl.yml b/jobs/templates/2019.2.0-heat-cicd-pike-dvr-sl.yml
index 09dddeb..8e6c353 100644
--- a/jobs/templates/2019.2.0-heat-cicd-pike-dvr-sl.yml
+++ b/jobs/templates/2019.2.0-heat-cicd-pike-dvr-sl.yml
@@ -214,6 +214,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      daysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/2019.2.0-heat-cicd-queens-contrail41-sl.yml b/jobs/templates/2019.2.0-heat-cicd-queens-contrail41-sl.yml
index da2f030..a5717ad 100644
--- a/jobs/templates/2019.2.0-heat-cicd-queens-contrail41-sl.yml
+++ b/jobs/templates/2019.2.0-heat-cicd-queens-contrail41-sl.yml
@@ -219,7 +219,7 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
diff --git a/jobs/templates/2019.2.0-heat-cicd-queens-dvr-sl.yml b/jobs/templates/2019.2.0-heat-cicd-queens-dvr-sl.yml
index ca9f0f5..6eeb8a8 100644
--- a/jobs/templates/2019.2.0-heat-cicd-queens-dvr-sl.yml
+++ b/jobs/templates/2019.2.0-heat-cicd-queens-dvr-sl.yml
@@ -219,6 +219,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/bm-b300-cicd-queens-ovs-maas.yml b/jobs/templates/bm-b300-cicd-queens-ovs-maas.yml
index 669390a..f58de1c 100644
--- a/jobs/templates/bm-b300-cicd-queens-ovs-maas.yml
+++ b/jobs/templates/bm-b300-cicd-queens-ovs-maas.yml
@@ -218,6 +218,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/bm-cicd-pike-ovs-maas.yml b/jobs/templates/bm-cicd-pike-ovs-maas.yml
index 5de2225..5092db1 100644
--- a/jobs/templates/bm-cicd-pike-ovs-maas.yml
+++ b/jobs/templates/bm-cicd-pike-ovs-maas.yml
@@ -205,7 +205,7 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
diff --git a/jobs/templates/bm-cicd-queens-ovs-maas.yml b/jobs/templates/bm-cicd-queens-ovs-maas.yml
index 9f62f1f..61384af 100644
--- a/jobs/templates/bm-cicd-queens-ovs-maas.yml
+++ b/jobs/templates/bm-cicd-queens-ovs-maas.yml
@@ -218,6 +218,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/bm-e7-cicd-pike-odl-maas.yml b/jobs/templates/bm-e7-cicd-pike-odl-maas.yml
index a49c9ab..7507fa1 100644
--- a/jobs/templates/bm-e7-cicd-pike-odl-maas.yml
+++ b/jobs/templates/bm-e7-cicd-pike-odl-maas.yml
@@ -215,7 +215,7 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
diff --git a/jobs/templates/bm-e7-cicd-pike-ovs-maas.yml b/jobs/templates/bm-e7-cicd-pike-ovs-maas.yml
index af34ce7..25b7560 100644
--- a/jobs/templates/bm-e7-cicd-pike-ovs-maas.yml
+++ b/jobs/templates/bm-e7-cicd-pike-ovs-maas.yml
@@ -210,7 +210,7 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
diff --git a/jobs/templates/cleanup-jenkins-agents.yml b/jobs/templates/cleanup-jenkins-agents.yml
index 3fa97b4..46039b5 100644
--- a/jobs/templates/cleanup-jenkins-agents.yml
+++ b/jobs/templates/cleanup-jenkins-agents.yml
@@ -14,6 +14,6 @@
           - master
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/remove-old-jenkins-agents.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
\ No newline at end of file
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
\ No newline at end of file
diff --git a/jobs/templates/deploy-released.yml b/jobs/templates/deploy-released.yml
index 7f90648..714d29e 100644
--- a/jobs/templates/deploy-released.yml
+++ b/jobs/templates/deploy-released.yml
@@ -58,6 +58,6 @@
           clean:
             before: true
       script-path: jobs/pipelines/rotation-released-deployment.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/deploy_bm.yml b/jobs/templates/deploy_bm.yml
index 1ab474c..eaa6b04 100644
--- a/jobs/templates/deploy_bm.yml
+++ b/jobs/templates/deploy_bm.yml
@@ -52,7 +52,7 @@
             refspec: ${{TCP_QA_REFS}}
             url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/rotation_bm_deployments.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
diff --git a/jobs/templates/download-config-drive.yml b/jobs/templates/download-config-drive.yml
index d636dbc..94269ec 100644
--- a/jobs/templates/download-config-drive.yml
+++ b/jobs/templates/download-config-drive.yml
@@ -105,9 +105,9 @@
 
       }}
     name: download-config-drive
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
     parameters:
     - string:
         default: ''
diff --git a/jobs/templates/heat-bm-cicd-pike-contrail-sl.yml b/jobs/templates/heat-bm-cicd-pike-contrail-sl.yml
index bead0a8..d8f618b 100644
--- a/jobs/templates/heat-bm-cicd-pike-contrail-sl.yml
+++ b/jobs/templates/heat-bm-cicd-pike-contrail-sl.yml
@@ -231,6 +231,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/heat-bm-cicd-queens-contrail-sl.yml b/jobs/templates/heat-bm-cicd-queens-contrail-sl.yml
index 87cf161..a06d317 100644
--- a/jobs/templates/heat-bm-cicd-queens-contrail-sl.yml
+++ b/jobs/templates/heat-bm-cicd-queens-contrail-sl.yml
@@ -232,6 +232,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/heat-cicd-pike-dvr-sl.yml b/jobs/templates/heat-cicd-pike-dvr-sl.yml
index 91db005..7f48f08 100644
--- a/jobs/templates/heat-cicd-pike-dvr-sl.yml
+++ b/jobs/templates/heat-cicd-pike-dvr-sl.yml
@@ -9,8 +9,8 @@
     triggers:
     - timed: '{obj:trigger_time}'
     properties:
-    - logrotate:
-        DaysToKeep: 365
+    - build-discarder:
+        days-to-keep: 365
         num-to-keep: 50
     parameters:
     - string:
@@ -221,6 +221,6 @@
           clean:
             before: true
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/heat-cicd-queens-contrail41-sl.yml b/jobs/templates/heat-cicd-queens-contrail41-sl.yml
index d4460c6..248fdbe 100644
--- a/jobs/templates/heat-cicd-queens-contrail41-sl.yml
+++ b/jobs/templates/heat-cicd-queens-contrail41-sl.yml
@@ -217,7 +217,7 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
diff --git a/jobs/templates/heat-cicd-queens-dvr-sl.yml b/jobs/templates/heat-cicd-queens-dvr-sl.yml
index 9e2ecc5..1cdacfa 100644
--- a/jobs/templates/heat-cicd-queens-dvr-sl.yml
+++ b/jobs/templates/heat-cicd-queens-dvr-sl.yml
@@ -218,7 +218,7 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
diff --git a/jobs/templates/release-artifact-checker.yml b/jobs/templates/release-artifact-checker.yml
index 9462e15..1b9cd07 100644
--- a/jobs/templates/release-artifact-checker.yml
+++ b/jobs/templates/release-artifact-checker.yml
@@ -9,6 +9,6 @@
     builders:
     - shell:
         "python3 jobs/scripts/mcp_mu_release_artifact_checker.py"
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/released-bm-b300-cicd-queens-ovs-maas.yml b/jobs/templates/released-bm-b300-cicd-queens-ovs-maas.yml
index d577e73..751804b 100644
--- a/jobs/templates/released-bm-b300-cicd-queens-ovs-maas.yml
+++ b/jobs/templates/released-bm-b300-cicd-queens-ovs-maas.yml
@@ -227,6 +227,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/released-bm-pike-ovs.yml b/jobs/templates/released-bm-pike-ovs.yml
index 0f9181d..3ef04da 100644
--- a/jobs/templates/released-bm-pike-ovs.yml
+++ b/jobs/templates/released-bm-pike-ovs.yml
@@ -198,6 +198,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/released-heat-cicd-pike-contrail41-sl.yml b/jobs/templates/released-heat-cicd-pike-contrail41-sl.yml
index f54744f..a8922d8 100644
--- a/jobs/templates/released-heat-cicd-pike-contrail41-sl.yml
+++ b/jobs/templates/released-heat-cicd-pike-contrail41-sl.yml
@@ -230,6 +230,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/released-heat-cicd-pike-dvr-sl.yml b/jobs/templates/released-heat-cicd-pike-dvr-sl.yml
index 240e443..398a114 100644
--- a/jobs/templates/released-heat-cicd-pike-dvr-sl.yml
+++ b/jobs/templates/released-heat-cicd-pike-dvr-sl.yml
@@ -230,6 +230,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/released-heat-cicd-queens-contrail41-sl.yml b/jobs/templates/released-heat-cicd-queens-contrail41-sl.yml
index cb714cc..4dfd557 100644
--- a/jobs/templates/released-heat-cicd-queens-contrail41-sl.yml
+++ b/jobs/templates/released-heat-cicd-queens-contrail41-sl.yml
@@ -233,6 +233,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/released-heat-cicd-queens-dvr-sl.yml b/jobs/templates/released-heat-cicd-queens-dvr-sl.yml
index 54c0eae..eb93df6 100644
--- a/jobs/templates/released-heat-cicd-queens-dvr-sl.yml
+++ b/jobs/templates/released-heat-cicd-queens-dvr-sl.yml
@@ -230,6 +230,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/self-deploy-jobs.yaml b/jobs/templates/self-deploy-jobs.yaml
index c38d9ae..6bea711 100644
--- a/jobs/templates/self-deploy-jobs.yaml
+++ b/jobs/templates/self-deploy-jobs.yaml
@@ -24,6 +24,6 @@
           refspec: '${{TCP_QA_REFS}}'
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/self-deploy-jobs.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/self-deploy-virtulenvs.yaml b/jobs/templates/self-deploy-virtulenvs.yaml
index c5fd64c..8cc4d47 100644
--- a/jobs/templates/self-deploy-virtulenvs.yaml
+++ b/jobs/templates/self-deploy-virtulenvs.yaml
@@ -20,8 +20,8 @@
     builders:
       - shell: "chmod +x tcp_tests/templates/_packer/scripts/jenkins_virtualenvs.sh"
       - shell: "export CHANGE_RIGHTS=false ; ./tcp_tests/templates/_packer/scripts/jenkins_virtualenvs.sh"
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
 
diff --git a/jobs/templates/swarm-deploy-cicd.yml b/jobs/templates/swarm-deploy-cicd.yml
index aee3e01..217c6bf 100644
--- a/jobs/templates/swarm-deploy-cicd.yml
+++ b/jobs/templates/swarm-deploy-cicd.yml
@@ -69,6 +69,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/swarm-deploy-cicd.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/swarm-deploy-platform.yml b/jobs/templates/swarm-deploy-platform.yml
index cc97ccb..dbcaae5 100644
--- a/jobs/templates/swarm-deploy-platform.yml
+++ b/jobs/templates/swarm-deploy-platform.yml
@@ -70,6 +70,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/swarm-deploy-platform.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/swarm-run-pytest.yml b/jobs/templates/swarm-run-pytest.yml
index 681c460..a511794 100644
--- a/jobs/templates/swarm-run-pytest.yml
+++ b/jobs/templates/swarm-run-pytest.yml
@@ -89,6 +89,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/swarm-run-pytest.groovy
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
diff --git a/jobs/templates/test-scenarios.yml b/jobs/templates/test-scenarios.yml
index 2df3f5d..1d26ca0 100644
--- a/jobs/templates/test-scenarios.yml
+++ b/jobs/templates/test-scenarios.yml
@@ -93,9 +93,9 @@
 
     jobs:
       - '{test_scenario}'
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
 - job-group:
     name: 'ceph-tests'
@@ -118,9 +118,9 @@
           display-name: Failover tests for Ceph nodes
     jobs:
       - '{test_scenario}'
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
 - job-group:
     name: 'update-tests'
@@ -206,9 +206,9 @@
 
     jobs:
       - '{test_scenario}'
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
 
 ###################### JOB TEMPLATE ###################
 - job-template:
@@ -220,9 +220,9 @@
     disabled: '{disabled|false}'
     quiet-period: 2
     node: 'openstack_slave_{deployment}'
-    logrotate:
-      DaysToKeep: 365
-      artifactDaysToKeep: 60
+    build-discarder:
+      days-to-keep: 365
+      artifact-days-to-keep: 60
       num-to-keep: 60
       artifact-num-to-keep: 60
     # Requires the Jenkins BuildResultTrigger Plugin