Add ability to reconfigure gerrit trigger
Add ability manage build of patches
https://mirantis.jira.com/browse/PROD-20769
Change-Id: I886eff6e5ad82e582c44bd13e362e73b985a100f
diff --git a/_states/jenkins_gerrit.py b/_states/jenkins_gerrit.py
index 26b1259..a2b0e95 100644
--- a/_states/jenkins_gerrit.py
+++ b/_states/jenkins_gerrit.py
@@ -15,7 +15,10 @@
def present(name, hostname, username, frontendurl, auth_key_file, authkey,
- port="29418", auth_key_file_password=None, email="", proxy=""):
+ port="29418", build_current_patches_only="false",
+ abort_new_patchsets="false", abort_manual_patchsets="false",
+ abort_same_topic="false", auth_key_file_password=None, email="",
+ proxy=""):
"""
Jenkins gerrit-trigger state method
@@ -26,6 +29,10 @@
:param port: server ssh port
:param proxy: proxy url (optional)
:param frontendurl: server frontend URL
+ :param build_current_patches_only: build current patches only (optional)
+ :abort_new_patchsets: abort new patchsets (optional)
+ :abort_manual_patchsets: abort manual patchsets (optional)
+ :abort_same_topic: abort same topic (optional)
:param auth_key_file: path to key file
:param authkey: ssh key
:param auth_key_file_password: password for keyfile (optional)
@@ -35,7 +42,7 @@
'salt://jenkins/files/groovy/gerrit.template',
__env__)
return __salt__['jenkins_common.api_call'](name, template,
- ["CREATED", "EXISTS"],
+ ["CREATED", "CHANGED", "SKIPPED"],
{
"name": name,
"hostname": hostname,
@@ -44,8 +51,12 @@
"username": username,
"email": email if email else "",
"frontendurl": frontendurl,
+ "build_current_patches_only": build_current_patches_only if build_current_patches_only else "false",
+ "abort_new_patchsets": abort_new_patchsets if abort_new_patchsets else "false",
+ "abort_manual_patchsets": abort_manual_patchsets if abort_manual_patchsets else "false",
+ "abort_same_topic": abort_same_topic if abort_same_topic else "false",
"auth_key_file": auth_key_file,
"authkey": authkey,
- "auth_key_file_password": auth_key_file_password if auth_key_file_password else None
+ "auth_key_file_password": auth_key_file_password if auth_key_file_password else ""
},
"Gerrit server")