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:
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.
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