Re: Automatically creating a job inside a folder

2013-08-06 Thread Jacob Schlather
Very strange  true  was in my template. I had made a 
jenkins job as my template and copied that config.xml for my template. 

Changing that to false fixed the issue. Perhaps the project was disabled at 
the time I copied it without realizing. Thanks a lot. 

On Tuesday, August 6, 2013 3:10:50 PM UTC-4, Daniel Beck wrote:
>
> Can't think of a reason other than possibly 'true' in 
> your template. 
>
> Are your template file and the config.xml of the created job different in 
> any way? 
>
> What happens when you create a new freestyle job using the UI, get its 
> config.xml after it's saved, and post that? Still disabled? 
>
> On 06.08.2013, at 21:05, Jacob Schlather > 
> wrote: 
>
> > Great. That worked. 
> > 
> > Do you by chance know why my jobs would spawn as disabled rather than 
> enabled? 
> > 
> > On Tuesday, August 6, 2013 2:59:18 PM UTC-4, Daniel Beck wrote: 
> > Try http://jenkins/job/foldername/createItem. 
> > 
> > On 06.08.2013, at 17:17, Jacob Schlather  wrote: 
> > 
> > > I'm working on a script right now to create a new job whenever a new 
> branch is added to our git repo. I have the python code that will post a 
> job, but I would like to post a job inside a folder because our Jenkins CI 
> is already fairly cluttered at the moment due to the large number of 
> projects we currently have running. The code I currently have is: 
> > > 
> > > import requests 
> > > 
> > > xml_data=open("config_template.xml",'r').read() 
> > > headers = {'Content-Type': 'text/xml'} 
> > > jenkins_url="http://jenkins_server/createItem"; 
> > > keyargs= {'params':{'name': 'TEST_JOB_2.0'}, "headers" : 
> headers,"auth":('user','password'),"data":xml_data} 
> > > 
> > > response=requests.post(jenkins_url,**keyargs) 
> > > 
> > > This works fine to post a job, but I couldn't find any parameters I 
> could pass to create it inside a folder. Is there another rest command that 
> will move a job to a folder that I could execute afterwards. 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> Groups "Jenkins Users" group. 
> > > To unsubscribe from this group and stop receiving emails from it, send 
> an email to jenkinsci-use...@googlegroups.com. 
> > > For more options, visit https://groups.google.com/groups/opt_out. 
> > >   
> > >   
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Jenkins Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to jenkinsci-use...@googlegroups.com . 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> >   
> >   
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Automatically creating a job inside a folder

2013-08-06 Thread Daniel Beck
Can't think of a reason other than possibly 'true' in your 
template.

Are your template file and the config.xml of the created job different in any 
way?

What happens when you create a new freestyle job using the UI, get its 
config.xml after it's saved, and post that? Still disabled?

On 06.08.2013, at 21:05, Jacob Schlather  wrote:

> Great. That worked. 
> 
> Do you by chance know why my jobs would spawn as disabled rather than enabled?
> 
> On Tuesday, August 6, 2013 2:59:18 PM UTC-4, Daniel Beck wrote:
> Try http://jenkins/job/foldername/createItem. 
> 
> On 06.08.2013, at 17:17, Jacob Schlather  wrote: 
> 
> > I'm working on a script right now to create a new job whenever a new branch 
> > is added to our git repo. I have the python code that will post a job, but 
> > I would like to post a job inside a folder because our Jenkins CI is 
> > already fairly cluttered at the moment due to the large number of projects 
> > we currently have running. The code I currently have is: 
> > 
> > import requests 
> > 
> > xml_data=open("config_template.xml",'r').read() 
> > headers = {'Content-Type': 'text/xml'} 
> > jenkins_url="http://jenkins_server/createItem"; 
> > keyargs= {'params':{'name': 'TEST_JOB_2.0'}, "headers" : 
> > headers,"auth":('user','password'),"data":xml_data} 
> > 
> > response=requests.post(jenkins_url,**keyargs) 
> > 
> > This works fine to post a job, but I couldn't find any parameters I could 
> > pass to create it inside a folder. Is there another rest command that will 
> > move a job to a folder that I could execute afterwards. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Jenkins Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to jenkinsci-use...@googlegroups.com. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> >   
> >   
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Automatically creating a job inside a folder

2013-08-06 Thread Jacob Schlather
Great. That worked. 

Do you by chance know why my jobs would spawn as disabled rather than 
enabled?

On Tuesday, August 6, 2013 2:59:18 PM UTC-4, Daniel Beck wrote:
>
> Try http://jenkins/job/foldername/createItem. 
>
> On 06.08.2013, at 17:17, Jacob Schlather > 
> wrote: 
>
> > I'm working on a script right now to create a new job whenever a new 
> branch is added to our git repo. I have the python code that will post a 
> job, but I would like to post a job inside a folder because our Jenkins CI 
> is already fairly cluttered at the moment due to the large number of 
> projects we currently have running. The code I currently have is: 
> > 
> > import requests 
> > 
> > xml_data=open("config_template.xml",'r').read() 
> > headers = {'Content-Type': 'text/xml'} 
> > jenkins_url="http://jenkins_server/createItem"; 
> > keyargs= {'params':{'name': 'TEST_JOB_2.0'}, "headers" : 
> headers,"auth":('user','password'),"data":xml_data} 
> > 
> > response=requests.post(jenkins_url,**keyargs) 
> > 
> > This works fine to post a job, but I couldn't find any parameters I 
> could pass to create it inside a folder. Is there another rest command that 
> will move a job to a folder that I could execute afterwards. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Jenkins Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to jenkinsci-use...@googlegroups.com . 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> >   
> >   
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Automatically creating a job inside a folder

2013-08-06 Thread Daniel Beck
Try http://jenkins/job/foldername/createItem.

On 06.08.2013, at 17:17, Jacob Schlather  wrote:

> I'm working on a script right now to create a new job whenever a new branch 
> is added to our git repo. I have the python code that will post a job, but I 
> would like to post a job inside a folder because our Jenkins CI is already 
> fairly cluttered at the moment due to the large number of projects we 
> currently have running. The code I currently have is:
> 
> import requests
> 
> xml_data=open("config_template.xml",'r').read()
> headers = {'Content-Type': 'text/xml'}
> jenkins_url="http://jenkins_server/createItem";
> keyargs= {'params':{'name': 'TEST_JOB_2.0'}, "headers" : 
> headers,"auth":('user','password'),"data":xml_data}
> 
> response=requests.post(jenkins_url,**keyargs)
> 
> This works fine to post a job, but I couldn't find any parameters I could 
> pass to create it inside a folder. Is there another rest command that will 
> move a job to a folder that I could execute afterwards.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Automatically creating a job inside a folder

2013-08-06 Thread Jacob Schlather
It's actually a folder plugin offered through cloudbees, which I hadn't 
realized prior to posting this question. Looking at the documentation for 
it there probably isn't the available functionality to do what I want it to 
do. Your view suggestion is a good alternative though. Thank you.

On Tuesday, August 6, 2013 1:27:14 PM UTC-4, Gareth Bowles wrote:
>
> By "folder", do you mean a view created with the View plugin ?  If so, you 
> can use a regex in the view definition that selects jobs by a substring in 
> their name, as there will be no need to do anything extra in your script.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Automatically creating a job inside a folder

2013-08-06 Thread Gareth Bowles
By "folder", do you mean a view created with the View plugin ?  If so, you 
can use a regex in the view definition that selects jobs by a substring in 
their name, as there will be no need to do anything extra in your script.


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Automatically creating a job inside a folder

2013-08-06 Thread Jacob Schlather
I'm working on a script right now to create a new job whenever a new branch 
is added to our git repo. I have the python code that will post a job, but 
I would like to post a job inside a folder because our Jenkins CI is 
already fairly cluttered at the moment due to the large number of projects 
we currently have running. The code I currently have is:

import requests

xml_data=open("config_template.xml",'r').read()
headers = {'Content-Type': 'text/xml'}
jenkins_url="http://jenkins_server/createItem";
keyargs= {'params':{'name': 'TEST_JOB_2.0'}, "headers" : 
headers,"auth":('user','password'),"data":xml_data}

response=requests.post(jenkins_url,**keyargs)

This works fine to post a job, but I couldn't find any parameters I could 
pass to create it inside a folder. Is there another rest command that will 
move a job to a folder that I could execute afterwards.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.