Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [hudson-dev] New Hudson-on-Hudson



On 2/8/12 1:11 PM, Henrik Lynggaard Hansen wrote:
2012/2/8 Winston Prakash<winston.prakash@xxxxxxxxx>:
On 2/8/12 10:56 AM, Henrik Lynggaard Hansen wrote:
2012/2/8 Winston Prakash<winston.prakash@xxxxxxxxx>:
* I would like to see the current jobs work on HonH before I start
converting the templates to use cascading as Xml structure has changed
and I have not had time to study it.
Theoretically, the XML structure should not change much, except adding one
field for cascading parent.
It does change a bit more, but I haven't looked at it closely

Theoretical design != practical implementation :-)

Agree for 2.1.2 or older. But I guess for 2.2.0 or later, including
cascading in the job creator tool makes it easy to create the template for
plugin jobs.
Not sure I understand that comment

In the jobcreator so far I only have 1 job template[*], all jobs are
created using that template. Each job only needs to define a few
properties like this:

<job name="hudson-plugins_blacklist">
   <inherit>
     <job>standard-build</job>
     <job>github</job>
   </inherit>
   <propertyset>
     <property name="displayname">Plugin: Blacklist</property>
     <property name="scm.git.path">/hudson-plugins/blacklist-plugin.git</property>
   </propertyset>
</job>

See below


*) And a few template fragments but they are not really essential and
are going away

I haven't gone through your job creator tool, but I guess is, it would be
easier to create the job using job creator tool, if your job creator tool
first create top-level and plugin-top-level jobs using "top-level" templates
and then rest of the plugin jobs using "plugin job" template that includes
"top-level" cascading in it.  Number of properties in the "plugin job"
template will be lesser. In its simplest form, the template need to be
parametrized only for the SCM property.
As you can see from above I am pretty much at that stage now, although
to be fair I am missing some functionality like picking up surefire
reports and adding sidebar links.

Checkout the commit needed to add the plot plugin:
https://github.com/hudson-plugins/hudson-on-hudson/commit/1e795d5e55e7651ddb324172b86967a08e3681f8#pipeline.xml
and then I ran "./jobloader.sh hudson-plugin http://localhost:8080/
henrik henrik"

I'm not sure if my understanding of your tool is correct, but I'm guessing, the tool is responsible for generating the job config XML by combining the XML corresponding to the jobs specified in <inherit> tag with XML fragment generated from <propertyset> tag.

From your example above hudson-plugins_blacklist.xml is a combination of standard-build.xml + github.xml + XML fragment generated from <propertyset>.

What I meant was, combining need to be done in 2.12 or earlier. But in 2.2.0 or later you could take advantage of cascading. So instead of combining, info from <inherit> tag could be used simply to inject the cascading parent in to job.xml.

For example, if I have

<job name="hudson-plugins_blacklist">
  <inherit>
    <job>plugin-top-level</job>
  </inherit>
  <propertyset>
    <property name="displayname">Plugin: Blacklist</property>
    <property name="scm.git.path">/hudson-plugins/blacklist-plugin.git</property>
  </propertyset>
</job>

hudson-plugins_blacklist.xml is an XML generated from <propertyset> and in to that XML, plugin-top-level will be inserted as
<cascadingProjectName>plugin-top-level</cascadingProjectName>

In your case the multiple inheritance is supported. Could be solved by another flag

<job name="hudson-plugins_blacklist">
  <inherit>
    <job>
        <name>plugin-top-level</name>
        <type>cascading</type>
    </job>
    <job>github</job>
    </inherit>
  <propertyset>
    <property name="displayname">Plugin: Blacklist</property>
    <property name="scm.git.path">/hudson-plugins/blacklist-plugin.git</property>
  </propertyset>
</job>

In the above example, for type cascading <cascadingProjectName> tag is inserted, for other actual XML fragment is inserted.

- Winston

Best regards
Henrik
_______________________________________________
hudson-dev mailing list
hudson-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/hudson-dev


Back to the top