Funny... I just created a test job with one file parameter and triggered without specifying a file. The job ran fine and there was no file in the workspace.
I'm running Jenkins 1.451 on Mac OS X 10.7. My Jenkins is not wrapped in any servlet container. -- Sami 2012/2/21 Andrew Melo <andrew.m...@gmail.com>: > > > On Mon, Feb 20, 2012 at 11:42 PM, Sami Tikka <sjti...@gmail.com> wrote: >> >> Sorry, but you lost me. How does urllib come into the picture? > > > Sorry, I should've clarified. > > We have a number of different tools that trigger builds with jenkins through > the REST interface. For instance, when someone posts a pull request to > github, a script makes a new branch in git and tells jenkins to build > against it. This works great, we have a build parameterization that tells > jenkins what branch to build, so I can just make a request to > http://jenkins.server/job/something/something/buildWithParameters?branch=test_branch9999 > and jenkins queues the build. We have a few different build parameters that > accept strings to let us configure different things about the job (i.e. > someone can request only an oracle or mysql backend if they're testing > specific functionality and want to save time). If all the parameters aren't > there, jenkins doesn't complain, it just takes the defaults. > > If I put in a file parameter into the configuration and try to trigger a > build, and no file is uploaded, jenkins throws a 500 error instead of simply > not putting a file into the job workdir. I would think the expected behavior > would be to just not put a file in the workdir. > > Thanks again, > Andrew > > > >> >> >> You configure the job to take file parameter and name it foo.tmp. Then >> your build script checks if file foo.tmp exists. If it does, rename it to >> foo and start testing it. If it doesn't, build foo and start testing it. >> >> -- Sami >> >> Andrew Melo <andrew.m...@gmail.com> kirjoitti 21.2.2012 kello 7.36: >> >> Hey Sami, >> >> On Mon, Feb 20, 2012 at 11:32 PM, Sami Tikka <sjti...@gmail.com> wrote: >>> >>> You just have to change your build scripts to use the uploaded file if it >>> exists in the workspace and do something else if it doesn't. >> >> >> I would like to do that, but it doesn't seem to work. If I make the call >> with urllib (I'm using python), I get a 500 error back (so the job never >> fires). If I add a file to it, the job works fine. If I remove the file >> parameterization, it works. It's just when I try to submit a job and don't >> include the file that things blow up. >> >> Unfortunately (well, fortunately in a way), I'm doing my qualifying exam >> tomorrow AM, so I can't dig out the backtrace, but one of the stack frames >> was in buildWithParameters. I can send that tomorrow once I'm done if that >> helps. >> >> Thanks! >> Andrew >> >>> >>> >>> -- Sami >>> >>> Andrew Melo <andrew.m...@gmail.com> kirjoitti 20.2.2012 kello 0.09: >>> >>> > Hello, everyone- >>> > >>> > We currently use jenkins to test commits that are in our Git >>> > repository, but I'd like to add support for developers to test their >>> > current workspace with jenkins before the commit makes it up. I added >>> > some logic to the beginning of the build process to unpack a tarball >>> > passed in with the file parameterization, which works great. However, >>> > any existing processes that try to submit a job end up failing if they >>> > don't pass in a file with the http request. >>> > >>> > Is there a way to have jenkins ignore if a file isn't passed in >>> > (perhaps making a zero-length file)? Or is there a better way to go >>> > about this? (Our job configuration is super complex, so maintaining >>> > two jobs with identical options modulo the build parameterization >>> > would probably end up with them desynchronizing). >>> > >>> > Thanks, >>> > Andrew >> >> >> >> >> -- >> -- >> Andrew Melo >> > > > > -- > -- > Andrew Melo >