Add job builds discarder

Change-Id: I7a4a46826b547731b91f2ed1f58927ba4ddd4455
diff --git a/jenkins/client/job/debian/packages/extra.yml b/jenkins/client/job/debian/packages/extra.yml
index 0a21a55..f3475b3 100644
--- a/jenkins/client/job/debian/packages/extra.yml
+++ b/jenkins/client/job/debian/packages/extra.yml
@@ -212,6 +212,11 @@
           template:
             type: workflow-scm
             concurrent: false
+            discard:
+              build:
+                keep_num: 10
+              artifact:
+                keep_num: 10
             scm:
               type: git
               url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
diff --git a/jenkins/client/job/debian/packages/testing.yml b/jenkins/client/job/debian/packages/testing.yml
index f150f80..84ff1cc 100644
--- a/jenkins/client/job/debian/packages/testing.yml
+++ b/jenkins/client/job/debian/packages/testing.yml
@@ -14,6 +14,11 @@
           template:
             type: workflow-scm
             concurrent: false
+            discard:
+              build:
+                keep_num: 10
+              artifact:
+                keep_num: 10
             scm:
               type: git
               url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
diff --git a/jenkins/client/job/deploy/update/cloud_update.yml b/jenkins/client/job/deploy/update/cloud_update.yml
index d434850..d4a05ec 100644
--- a/jenkins/client/job/deploy/update/cloud_update.yml
+++ b/jenkins/client/job/deploy/update/cloud_update.yml
@@ -10,6 +10,11 @@
         deploy-update-cloud:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - update cloud"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/config.yml b/jenkins/client/job/deploy/update/config.yml
index 7c75e5b..47ec321 100644
--- a/jenkins/client/job/deploy/update/config.yml
+++ b/jenkins/client/job/deploy/update/config.yml
@@ -10,6 +10,11 @@
         deploy-update-service-config:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - update service(s) config"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/kubernetes_update.yml b/jenkins/client/job/deploy/update/kubernetes_update.yml
index 9fb23f9..acdb8e0 100644
--- a/jenkins/client/job/deploy/update/kubernetes_update.yml
+++ b/jenkins/client/job/deploy/update/kubernetes_update.yml
@@ -11,6 +11,11 @@
         deploy-k8s-upgrade:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - update kubernetes cluster"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/package.yml b/jenkins/client/job/deploy/update/package.yml
index b276ce4..a485c3e 100644
--- a/jenkins/client/job/deploy/update/package.yml
+++ b/jenkins/client/job/deploy/update/package.yml
@@ -10,6 +10,11 @@
         deploy-update-package:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - update system package(s)"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/restore_cassandra.yml b/jenkins/client/job/deploy/update/restore_cassandra.yml
index 115f7a2..34179af 100644
--- a/jenkins/client/job/deploy/update/restore_cassandra.yml
+++ b/jenkins/client/job/deploy/update/restore_cassandra.yml
@@ -10,6 +10,11 @@
         deploy-cassandra-db-restore:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Cassandra - restore db"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/restore_mysql.yml b/jenkins/client/job/deploy/update/restore_mysql.yml
index 2c4ce12..aaf4552 100644
--- a/jenkins/client/job/deploy/update/restore_mysql.yml
+++ b/jenkins/client/job/deploy/update/restore_mysql.yml
@@ -10,6 +10,11 @@
         deploy-mysql-db-restore:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Xtrabackup - restore mysql db"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/restore_zookeeper.yml b/jenkins/client/job/deploy/update/restore_zookeeper.yml
index b6d044a..ebb57f7 100644
--- a/jenkins/client/job/deploy/update/restore_zookeeper.yml
+++ b/jenkins/client/job/deploy/update/restore_zookeeper.yml
@@ -10,6 +10,11 @@
         deploy-zookeeper-restore:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Zookeeper - restore"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/saltenv.yml b/jenkins/client/job/deploy/update/saltenv.yml
index 1ce1494..734a4e5 100644
--- a/jenkins/client/job/deploy/update/saltenv.yml
+++ b/jenkins/client/job/deploy/update/saltenv.yml
@@ -19,6 +19,11 @@
             display_name: "Deploy - update {{name}} environment"
             type: workflow-scm
             concurrent: false
+            discard:
+              build:
+                keep_num: 10
+              artifact:
+                keep_num: 10
             scm:
               type: git
               url: "${_param:jenkins_gerrit_url}/salt-models/{{name}}"
diff --git a/jenkins/client/job/deploy/update/update_mirror_image.yml b/jenkins/client/job/deploy/update/update_mirror_image.yml
index 2b2dc26..73fd434 100644
--- a/jenkins/client/job/deploy/update/update_mirror_image.yml
+++ b/jenkins/client/job/deploy/update/update_mirror_image.yml
@@ -10,6 +10,11 @@
         deploy-update-mirror-image:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - update local mirror"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/update_salt_environment.yml b/jenkins/client/job/deploy/update/update_salt_environment.yml
index f9ea6d5..dcc58d7 100644
--- a/jenkins/client/job/deploy/update/update_salt_environment.yml
+++ b/jenkins/client/job/deploy/update/update_salt_environment.yml
@@ -10,6 +10,11 @@
         deploy-update-salt-environment:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - update Salt environment"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/upgrade.yml b/jenkins/client/job/deploy/update/upgrade.yml
index 6ffc9c1..01fdf2a 100644
--- a/jenkins/client/job/deploy/update/upgrade.yml
+++ b/jenkins/client/job/deploy/update/upgrade.yml
@@ -10,6 +10,11 @@
         deploy-upgrade-control:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - upgrade control VMs"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/upgrade_compute.yml b/jenkins/client/job/deploy/update/upgrade_compute.yml
index 3986997..706863d 100644
--- a/jenkins/client/job/deploy/update/upgrade_compute.yml
+++ b/jenkins/client/job/deploy/update/upgrade_compute.yml
@@ -10,6 +10,11 @@
         deploy-upgrade-compute:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - upgrade computes"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/upgrade_mcp_release.yml b/jenkins/client/job/deploy/update/upgrade_mcp_release.yml
index c9b846f..5968245 100644
--- a/jenkins/client/job/deploy/update/upgrade_mcp_release.yml
+++ b/jenkins/client/job/deploy/update/upgrade_mcp_release.yml
@@ -10,6 +10,11 @@
         upgrade-mcp-release:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - upgrade MCP Drivetrain"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/upgrade_opencontrail.yml b/jenkins/client/job/deploy/update/upgrade_opencontrail.yml
index de7e46f..0b0d945 100644
--- a/jenkins/client/job/deploy/update/upgrade_opencontrail.yml
+++ b/jenkins/client/job/deploy/update/upgrade_opencontrail.yml
@@ -10,6 +10,11 @@
         deploy-upgrade-opencontrail:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - upgrade Opencontrail"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/upgrade_opencontrail4_0.yml b/jenkins/client/job/deploy/update/upgrade_opencontrail4_0.yml
index f622371..c1f448c 100644
--- a/jenkins/client/job/deploy/update/upgrade_opencontrail4_0.yml
+++ b/jenkins/client/job/deploy/update/upgrade_opencontrail4_0.yml
@@ -10,6 +10,11 @@
         deploy-upgrade-opencontrail40:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - upgrade Opencontrail to 4.x"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/upgrade_ovs_gateway.yml b/jenkins/client/job/deploy/update/upgrade_ovs_gateway.yml
index e7cdb12..b0c92b7 100644
--- a/jenkins/client/job/deploy/update/upgrade_ovs_gateway.yml
+++ b/jenkins/client/job/deploy/update/upgrade_ovs_gateway.yml
@@ -10,6 +10,11 @@
         deploy-upgrade-ovs-gateway:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - upgrade OVS gateway"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/utils.yml b/jenkins/client/job/deploy/update/utils.yml
index 1a6062e..ca669d4 100644
--- a/jenkins/client/job/deploy/update/utils.yml
+++ b/jenkins/client/job/deploy/update/utils.yml
@@ -5,6 +5,11 @@
         reclass_metadata_update:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - Update reclass metadata"
           scm:
             type: git
@@ -28,6 +33,11 @@
         salt_master_formula_update:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - Update salt master formulas"
           scm:
             type: git
@@ -51,6 +61,11 @@
         jenkins_master_job_update:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - Update jenkins master jobs"
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/update/virt_snapshot.yml b/jenkins/client/job/deploy/update/virt_snapshot.yml
index 0388ed1..be92c8d 100644
--- a/jenkins/client/job/deploy/update/virt_snapshot.yml
+++ b/jenkins/client/job/deploy/update/virt_snapshot.yml
@@ -10,6 +10,11 @@
         manage-virt-snapshot:
           type: workflow-scm
           concurrent: true
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           display_name: "Deploy - virt snapshot VM"
           scm:
             type: git
diff --git a/jenkins/client/job/image/centos.yml b/jenkins/client/job/image/centos.yml
index d5856e4..5358d92 100644
--- a/jenkins/client/job/image/centos.yml
+++ b/jenkins/client/job/image/centos.yml
@@ -9,6 +9,11 @@
         build-image-centos-7:
           type: workflow-scm
           concurrent: false
+          discard:
+            build:
+              keep_num: 5
+            artifact:
+              keep_num: 5
           scm:
             type: git
             url: "${_param:jenkins_packer_pipeline}"
diff --git a/jenkins/client/job/image/debian.yml b/jenkins/client/job/image/debian.yml
index ab17c06..eef4740 100644
--- a/jenkins/client/job/image/debian.yml
+++ b/jenkins/client/job/image/debian.yml
@@ -9,6 +9,11 @@
         build-image-debian-8:
           type: workflow-scm
           concurrent: false
+          discard:
+            build:
+              keep_num: 5
+            artifact:
+              keep_num: 5
           scm:
             type: git
             url: "${_param:jenkins_packer_pipeline}"
diff --git a/jenkins/client/job/image/ubuntu.yml b/jenkins/client/job/image/ubuntu.yml
index 8d7e1de..e4a8251 100644
--- a/jenkins/client/job/image/ubuntu.yml
+++ b/jenkins/client/job/image/ubuntu.yml
@@ -88,6 +88,13 @@
         build-image-ubuntu-16-04:
           type: workflow-scm
           concurrent: false
+          discard:
+            build:
+              keep_num: 5
+              keep_days: 5
+            artifact:
+              keep_num: 6
+              keep_days: 6
           scm:
             type: git
             url: "${_param:jenkins_packer_pipeline}"
diff --git a/jenkins/client/job/salt-formulas/release.yml b/jenkins/client/job/salt-formulas/release.yml
index fe6df5e..eca83f6 100644
--- a/jenkins/client/job/salt-formulas/release.yml
+++ b/jenkins/client/job/salt-formulas/release.yml
@@ -5,6 +5,11 @@
         release-salt-formulas:
           type: workflow-scm
           concurrent: false
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
           scm:
             type: git
             url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
diff --git a/jenkins/client/job/salt-models/generate.yml b/jenkins/client/job/salt-models/generate.yml
index 002c618..39af9b8 100644
--- a/jenkins/client/job/salt-models/generate.yml
+++ b/jenkins/client/job/salt-models/generate.yml
@@ -10,6 +10,11 @@
           template:
             type: workflow-scm
             concurrent: true
+            discard:
+              build:
+                keep_num: 10
+              artifact:
+                keep_num: 10
             display_name: "Generate reclass cluster {{cookiecutter_template}}"
             scm:
               type: git
diff --git a/jenkins/client/job/salt-models/git-mirrors.yml b/jenkins/client/job/salt-models/git-mirrors.yml
index a04043b..f567ba8 100644
--- a/jenkins/client/job/salt-models/git-mirrors.yml
+++ b/jenkins/client/job/salt-models/git-mirrors.yml
@@ -9,6 +9,11 @@
           template:
             type: workflow-scm
             concurrent: false
+            discard:
+              build:
+                keep_num: 10
+              artifact:
+                keep_num: 10
             scm:
               type: git
               url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"