| 1 |
# Copyright 2015 Hewlett-Packard Development Company, L.P. |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 |
# License for the specific language governing permissions and limitations |
| 13 |
# under the License. |
| 14 |
|
| 15 |
|
| 16 |
""" |
| 17 |
The External Job Project module handles creating ExternalJob Jenkins projects. |
| 18 |
You may specify ``externaljob`` in the ``project-type`` attribute of the |
| 19 |
:ref:`Job` definition. |
| 20 |
|
| 21 |
This type of job allows you to record the execution of a process run outside |
| 22 |
Jenkins, even on a remote machine. This is designed so that you can use |
| 23 |
Jenkins as a dashboard of your existing automation system. |
| 24 |
|
| 25 |
Requires the Jenkins :jenkins-plugins:`External Monitor Job Type Plugin |
| 26 |
<external-monitor-job>`. |
| 27 |
|
| 28 |
Example: |
| 29 |
|
| 30 |
.. literalinclude:: /../../tests/general/fixtures/project-type005.yaml |
| 31 |
|
| 32 |
""" |
| 33 |
|
| 34 |
import xml.etree.ElementTree as XML |
| 35 |
|
| 36 |
import jenkins_jobs.modules.base |
| 37 |
|
| 38 |
|
| 39 |
class ExternalJob(jenkins_jobs.modules.base.Base): |
| 40 |
sequence = 0 |
| 41 |
|
| 42 |
def root_xml(self, data): |
| 43 |
xml_parent = XML.Element("hudson.model.ExternalJob") |
| 44 |
return xml_parent |