Merge "Revert "Reduce artifacts TTL to 60 days""
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 8e6c353..aac7ab4 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,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
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 a5717ad..3e3f631 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,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
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
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 6eeb8a8..5e575af 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,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/bm-b300-cicd-queens-ovs-maas.yml b/jobs/templates/bm-b300-cicd-queens-ovs-maas.yml
index f58de1c..e64a02c 100644
--- a/jobs/templates/bm-b300-cicd-queens-ovs-maas.yml
+++ b/jobs/templates/bm-b300-cicd-queens-ovs-maas.yml
@@ -218,6 +218,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/bm-cicd-pike-ovs-maas.yml b/jobs/templates/bm-cicd-pike-ovs-maas.yml
index 5092db1..a3b6e4a 100644
--- a/jobs/templates/bm-cicd-pike-ovs-maas.yml
+++ b/jobs/templates/bm-cicd-pike-ovs-maas.yml
@@ -205,7 +205,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
diff --git a/jobs/templates/bm-cicd-queens-ovs-maas.yml b/jobs/templates/bm-cicd-queens-ovs-maas.yml
index 61384af..73b9196 100644
--- a/jobs/templates/bm-cicd-queens-ovs-maas.yml
+++ b/jobs/templates/bm-cicd-queens-ovs-maas.yml
@@ -218,6 +218,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/bm-e7-cicd-pike-odl-maas.yml b/jobs/templates/bm-e7-cicd-pike-odl-maas.yml
index 7507fa1..26e463e 100644
--- a/jobs/templates/bm-e7-cicd-pike-odl-maas.yml
+++ b/jobs/templates/bm-e7-cicd-pike-odl-maas.yml
@@ -215,7 +215,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
diff --git a/jobs/templates/bm-e7-cicd-pike-ovs-maas.yml b/jobs/templates/bm-e7-cicd-pike-ovs-maas.yml
index 25b7560..131f7e3 100644
--- a/jobs/templates/bm-e7-cicd-pike-ovs-maas.yml
+++ b/jobs/templates/bm-e7-cicd-pike-ovs-maas.yml
@@ -210,7 +210,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
diff --git a/jobs/templates/cleanup-jenkins-agents.yml b/jobs/templates/cleanup-jenkins-agents.yml
index 46039b5..859463c 100644
--- a/jobs/templates/cleanup-jenkins-agents.yml
+++ b/jobs/templates/cleanup-jenkins-agents.yml
@@ -14,6 +14,5 @@
           - master
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/remove-old-jenkins-agents.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
\ No newline at end of file
+    logrotate:
+      daysToKeep: 365
\ No newline at end of file
diff --git a/jobs/templates/deploy-released.yml b/jobs/templates/deploy-released.yml
index 714d29e..126b5e0 100644
--- a/jobs/templates/deploy-released.yml
+++ b/jobs/templates/deploy-released.yml
@@ -58,6 +58,5 @@
           clean:
             before: true
       script-path: jobs/pipelines/rotation-released-deployment.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/deploy_bm.yml b/jobs/templates/deploy_bm.yml
index eaa6b04..0e3c102 100644
--- a/jobs/templates/deploy_bm.yml
+++ b/jobs/templates/deploy_bm.yml
@@ -52,7 +52,6 @@
             refspec: ${{TCP_QA_REFS}}
             url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/rotation_bm_deployments.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
diff --git a/jobs/templates/download-config-drive.yml b/jobs/templates/download-config-drive.yml
index 94269ec..74bd001 100644
--- a/jobs/templates/download-config-drive.yml
+++ b/jobs/templates/download-config-drive.yml
@@ -105,9 +105,8 @@
 
       }}
     name: download-config-drive
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
     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 d8f618b..576936f 100644
--- a/jobs/templates/heat-bm-cicd-pike-contrail-sl.yml
+++ b/jobs/templates/heat-bm-cicd-pike-contrail-sl.yml
@@ -231,6 +231,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/heat-bm-cicd-queens-contrail-sl.yml b/jobs/templates/heat-bm-cicd-queens-contrail-sl.yml
index a06d317..313f9c6 100644
--- a/jobs/templates/heat-bm-cicd-queens-contrail-sl.yml
+++ b/jobs/templates/heat-bm-cicd-queens-contrail-sl.yml
@@ -232,6 +232,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/heat-cicd-pike-dvr-sl.yml b/jobs/templates/heat-cicd-pike-dvr-sl.yml
index 7f48f08..2ade702 100644
--- a/jobs/templates/heat-cicd-pike-dvr-sl.yml
+++ b/jobs/templates/heat-cicd-pike-dvr-sl.yml
@@ -10,7 +10,7 @@
     - timed: '{obj:trigger_time}'
     properties:
     - build-discarder:
-        days-to-keep: 365
+        days-to-keep: 60
         num-to-keep: 50
     parameters:
     - string:
@@ -221,6 +221,5 @@
           clean:
             before: true
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/heat-cicd-queens-contrail41-sl.yml b/jobs/templates/heat-cicd-queens-contrail41-sl.yml
index 248fdbe..2eca95b 100644
--- a/jobs/templates/heat-cicd-queens-contrail41-sl.yml
+++ b/jobs/templates/heat-cicd-queens-contrail41-sl.yml
@@ -217,7 +217,6 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
diff --git a/jobs/templates/heat-cicd-queens-dvr-sl.yml b/jobs/templates/heat-cicd-queens-dvr-sl.yml
index 1cdacfa..bcaaa84 100644
--- a/jobs/templates/heat-cicd-queens-dvr-sl.yml
+++ b/jobs/templates/heat-cicd-queens-dvr-sl.yml
@@ -218,7 +218,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
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
diff --git a/jobs/templates/release-artifact-checker.yml b/jobs/templates/release-artifact-checker.yml
index 1b9cd07..b1c9c29 100644
--- a/jobs/templates/release-artifact-checker.yml
+++ b/jobs/templates/release-artifact-checker.yml
@@ -9,6 +9,5 @@
     builders:
     - shell:
         "python3 jobs/scripts/mcp_mu_release_artifact_checker.py"
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
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 751804b..7fd05f8 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,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/released-bm-pike-ovs.yml b/jobs/templates/released-bm-pike-ovs.yml
index 3ef04da..ceb8563 100644
--- a/jobs/templates/released-bm-pike-ovs.yml
+++ b/jobs/templates/released-bm-pike-ovs.yml
@@ -198,6 +198,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/released-heat-cicd-pike-contrail41-sl.yml b/jobs/templates/released-heat-cicd-pike-contrail41-sl.yml
index a8922d8..37aadc0 100644
--- a/jobs/templates/released-heat-cicd-pike-contrail41-sl.yml
+++ b/jobs/templates/released-heat-cicd-pike-contrail41-sl.yml
@@ -230,6 +230,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/released-heat-cicd-pike-dvr-sl.yml b/jobs/templates/released-heat-cicd-pike-dvr-sl.yml
index 398a114..0ea7e7b 100644
--- a/jobs/templates/released-heat-cicd-pike-dvr-sl.yml
+++ b/jobs/templates/released-heat-cicd-pike-dvr-sl.yml
@@ -230,6 +230,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/released-heat-cicd-queens-contrail41-sl.yml b/jobs/templates/released-heat-cicd-queens-contrail41-sl.yml
index 4dfd557..91f5f18 100644
--- a/jobs/templates/released-heat-cicd-queens-contrail41-sl.yml
+++ b/jobs/templates/released-heat-cicd-queens-contrail41-sl.yml
@@ -233,6 +233,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/released-heat-cicd-queens-dvr-sl.yml b/jobs/templates/released-heat-cicd-queens-dvr-sl.yml
index eb93df6..1740a26 100644
--- a/jobs/templates/released-heat-cicd-queens-dvr-sl.yml
+++ b/jobs/templates/released-heat-cicd-queens-dvr-sl.yml
@@ -230,6 +230,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/deploy-cicd-and-run-tests.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/self-deploy-jobs.yaml b/jobs/templates/self-deploy-jobs.yaml
index 6bea711..64f1ec4 100644
--- a/jobs/templates/self-deploy-jobs.yaml
+++ b/jobs/templates/self-deploy-jobs.yaml
@@ -24,6 +24,5 @@
           refspec: '${{TCP_QA_REFS}}'
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
       script-path: jobs/pipelines/self-deploy-jobs.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/self-deploy-virtulenvs.yaml b/jobs/templates/self-deploy-virtulenvs.yaml
index 8cc4d47..75f6027 100644
--- a/jobs/templates/self-deploy-virtulenvs.yaml
+++ b/jobs/templates/self-deploy-virtulenvs.yaml
@@ -20,8 +20,7 @@
     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"
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
 
diff --git a/jobs/templates/swarm-deploy-cicd.yml b/jobs/templates/swarm-deploy-cicd.yml
index 217c6bf..5d24db3 100644
--- a/jobs/templates/swarm-deploy-cicd.yml
+++ b/jobs/templates/swarm-deploy-cicd.yml
@@ -69,6 +69,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/swarm-deploy-cicd.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/swarm-deploy-platform.yml b/jobs/templates/swarm-deploy-platform.yml
index dbcaae5..f6a2270 100644
--- a/jobs/templates/swarm-deploy-platform.yml
+++ b/jobs/templates/swarm-deploy-platform.yml
@@ -70,6 +70,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/swarm-deploy-platform.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/swarm-run-pytest.yml b/jobs/templates/swarm-run-pytest.yml
index a511794..e06b3ef 100644
--- a/jobs/templates/swarm-run-pytest.yml
+++ b/jobs/templates/swarm-run-pytest.yml
@@ -89,6 +89,5 @@
           refspec: ${{TCP_QA_REFS}}
           url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa.git
       script-path: jobs/pipelines/swarm-run-pytest.groovy
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
diff --git a/jobs/templates/test-scenarios.yml b/jobs/templates/test-scenarios.yml
index 1d26ca0..e8c5fb8 100644
--- a/jobs/templates/test-scenarios.yml
+++ b/jobs/templates/test-scenarios.yml
@@ -93,9 +93,8 @@
 
     jobs:
       - '{test_scenario}'
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
 - job-group:
     name: 'ceph-tests'
@@ -118,9 +117,8 @@
           display-name: Failover tests for Ceph nodes
     jobs:
       - '{test_scenario}'
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
 - job-group:
     name: 'update-tests'
@@ -206,9 +204,8 @@
 
     jobs:
       - '{test_scenario}'
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
+    logrotate:
+      daysToKeep: 365
 
 ###################### JOB TEMPLATE ###################
 - job-template:
@@ -220,11 +217,11 @@
     disabled: '{disabled|false}'
     quiet-period: 2
     node: 'openstack_slave_{deployment}'
-    build-discarder:
-      days-to-keep: 365
-      artifact-days-to-keep: 60
-      num-to-keep: 60
-      artifact-num-to-keep: 60
+    logrotate:
+      daysToKeep: 365
+      numToKeep: 60
+      artifactDaysToKeep: -1
+      artifactNumToKeep: -1
     # Requires the Jenkins BuildResultTrigger Plugin
     triggers:
       - build-result: