diff --git a/jenkins_jobs/modules/wrappers.py b/jenkins_jobs/modules/wrappers.py index f82c578f9..61cf0af96 100644 --- a/jenkins_jobs/modules/wrappers.py +++ b/jenkins_jobs/modules/wrappers.py @@ -1284,6 +1284,30 @@ def custom_tools(parser, xml_parent, data): 'convertHomesToUppercase').text = convert_home +def xvnc(parser, xml_parent, data): + """yaml: xvnc + Enable xvnc during the build. + Requires the Jenkins `xvnc plugin. + `_ + + :arg bool screenshot: Take screenshot upon build completion + (default: false) + :arg bool xauthority: Create a dedicated Xauthority file per build + (default: true) + + Example: + + .. literalinclude:: /../../tests/wrappers/fixtures/xvnc001.yaml + + """ + xwrapper = XML.SubElement(xml_parent, + 'hudson.plugins.xvnc.Xvnc') + XML.SubElement(xwrapper, 'takeScreenshot').text = str( + data.get('screenshot', False)).lower() + XML.SubElement(xwrapper, 'useXauthority').text = str( + data.get('xauthority', True)).lower() + + class Wrappers(jenkins_jobs.modules.base.Base): sequence = 80 diff --git a/setup.cfg b/setup.cfg index 732799149..2b7496006 100644 --- a/setup.cfg +++ b/setup.cfg @@ -235,6 +235,7 @@ jenkins_jobs.wrappers = timeout=jenkins_jobs.modules.wrappers:timeout timestamps=jenkins_jobs.modules.wrappers:timestamps workspace-cleanup=jenkins_jobs.modules.wrappers:workspace_cleanup + xvnc=jenkins_jobs.modules.wrappers:xvnc jenkins_jobs.modules = builders=jenkins_jobs.modules.builders:Builders general=jenkins_jobs.modules.general:General diff --git a/tests/wrappers/fixtures/xvnc001.xml b/tests/wrappers/fixtures/xvnc001.xml new file mode 100644 index 000000000..42095a035 --- /dev/null +++ b/tests/wrappers/fixtures/xvnc001.xml @@ -0,0 +1,9 @@ + + + + + true + false + + + diff --git a/tests/wrappers/fixtures/xvnc001.yaml b/tests/wrappers/fixtures/xvnc001.yaml new file mode 100644 index 000000000..d0186f76e --- /dev/null +++ b/tests/wrappers/fixtures/xvnc001.yaml @@ -0,0 +1,4 @@ +wrappers: + - xvnc: + screenshot: true + xauthority: false