Jenkins job builder -- Cannot create pipeline style jobs

729 views
Skip to first unread message

Ramanathan Muthaiah

unread,
Jun 11, 2017, 9:43:11 AM6/11/17
to Jenkins Users
Hi All,

Pls bear with me for the lengthy post. I did go through the documentation (JJB) on how to create jobs of freestyle and pipeline style. 


With JJB installed in an Ubuntu box (running in Vagrant), I could create simple freestyle jobs. 

However, the same is not the case with simple pipeline jobs.


a) YAML code used to create pipeline job was based on the example in the section, “Pipeline as code” example", given here, https://docs.openstack.org/infra/jenkins-job-builder/project_pipeline.html


- job:







-job:

   name: JJB_OSFY

   project-type: pipeline

   sandbox: true

   pipeline-scm:

     scm:

      - git:

          url: https://github.com/mramanathan/OSFY.git

          clean: true

     script-path: Jenkinsfile



b) And the command tried to create pipeline job. Example code was stored in pipdemo.yaml

jenkins-jobs --conf server.ini update pipdemo.yaml


c) Output from the command:


++++++++++++++

INFO:root:Updating jobs in ['pipdemo.yaml'] ([]) INFO:jenkins_jobs.builder:Number of jobs generated: 1 Traceback (most recent call last): File "/home/ubuntu/.local/bin/jenkins-jobs", line 11, in sys.exit(main()) File "/home/ubuntu/.local/lib/python2.7/site-packages/jenkins_jobs/cmd.py", line 191, in main execute(options, config) File "/home/ubuntu/.local/lib/python2.7/site-packages/jenkins_jobs/cmd.py", line 372, in execute n_workers=options.n_workers) File "/home/ubuntu/.local/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 356, in update_jobs self.parser.xml_jobs.sort(key=operator.attrgetter('name')) AttributeError: 'NoneType' object has no attribute 'name'

+++++++++++++++++


d) FWIW, freestyle jobs were created using the same server.ini.


Any help would be appreciated.


NOTE:


Pls excuse me for posting this issue to this group. I did post it to JJB forum but haven't got any response until now, so, trying my luck here!

Narayana Reddy

unread,
Jun 23, 2017, 6:00:48 AM6/23/17
to Jenkins Users
Hi Ramanath, Hope you have resolved this issue. Actually I am facing same issue with the pipeline module .. I am using JJB 1.4 version on Jenkins2.0 which got a pipeline plugin version 2.5 . 

Please let me know if have managed to resolved.

Cheers
Reddy

Ramanathan Muthaiah

unread,
Jun 25, 2017, 4:59:54 AM6/25/17
to Jenkins Users
Hi Ramanath, Hope you have resolved this issue. Actually I am facing same issue with the pipeline module .. I am using JJB 1.4 version on Jenkins2.0 which got a pipeline plugin version 2.5 . 

Please let me know if have managed to resolved.


After my initial post, have not been able to spend any time on this issue nor any leads from this forum on possible solutions.

So, the issue is very much open!!!

/Ram

Matthew Wilmott

unread,
Jun 30, 2017, 12:05:47 AM6/30/17
to Jenkins Users
Yeah in the same boat unfortunately... if I get a chance I'll check out the source and see whats happening

Matthew Wilmott

unread,
Jun 30, 2017, 12:35:14 AM6/30/17
to Jenkins Users
Okay so it looks like it relies on the 2.x codebase which is beta. Pip had installed version 1.6 by default, upgraded using pip and rerun the test script which worked. Now its obviously a beta build but I'm only currently building out my env so I don't mind at this rate, it should mature y the time I need to use it in anger.

Note - I had to remove the "     scm:" line beneath the pipeline-scm it appears to be superfluous

Ramanathan Muthaiah

unread,
Jul 1, 2017, 2:07:12 AM7/1/17
to jenkins...@googlegroups.com
On Fri, Jun 30, 2017 at 10:05 AM Matthew Wilmott <mattw...@gmail.com> wrote:
Okay so it looks like it relies on the 2.x codebase which is beta. Pip had installed version 1.6 by default, upgraded using pip and rerun the test script which worked. Now its obviously a beta build but I'm only currently building out my env so I don't mind at this rate, it should mature y the time I need to use it in anger.

Note - I had to remove the "     scm:" line beneath the pipeline-scm it appears to be superfluous

Great news and thank you very much for sharing your findings.

In a fresh instance of Jenkins, with JJB 2.0.0.0b2 beta version, I reran the script and it worked.

Why JJB project did not mention this issue in their project website [ https://docs.openstack.org/infra/jenkins-job-builde ] is surprising?

/Ram

 
Reply all
Reply to author
Forward
0 new messages