Re: Alternative to EnvInject?

2016-05-25 Thread 'Niksan' via Jenkins Users
Messy indeed. :) Well, with luck I stumbled across this. https://themettlemonkey.wordpress.com/2014/10/03/programmatically-set-jenkins-build-variables/ And a bit of digging was able to utilize the EnvInject's plugin EnvInjectBuilderContributionAction. That left me with a more flexible and sane

Alternative to EnvInject?

2016-05-25 Thread 'Niksan' via Jenkins Users
I'm trying to inject a variable in to a job mid-flight who triggers another job and waits for it, 'inject environment variables' seems to do what I want with the caveat being it doesn't appear to do parameter substitution. My build step does : build.addAction(new ParametersAction([ new

Controlling user Jenkins runs as

2016-05-24 Thread 'Niksan' via Jenkins Users
If you're running as a service, change the service settings to run as whichever user you desire. I think it defaults to user 'system' by default. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop

Re: How to get enviroment variables / build parameters from groovy run on slave?

2016-05-24 Thread 'Niksan' via Jenkins Users
and, slightly changing my google search terms led me to this. https://rucialk.wordpress.com/2016/03/17/jenkins-groovy-accessing-build-parameters/ Winner! On Monday, May 23, 2016 at 6:05:44 PM UTC+1, Niksan wrote: > > Pretty much as the subject says, getting them when running as a

How to get enviroment variables / build parameters from groovy run on slave?

2016-05-23 Thread 'Niksan' via Jenkins Users
Pretty much as the subject says, getting them when running as a system script is easy enough, but as there's no access to 'build' a a none system script run on a slave, how does one do that? -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To

Create a temporay file via groovy

2016-05-23 Thread 'Niksan' via Jenkins Users
I'm wanting to create a temporary batchfile on a Jenkins slave via groovy similar to the way Jenkins itself does when invoking a Windows batch file. cmd /c call C:\Windows\TEMP\hudson6180922768700485046.bat How do I go about doing that via groovy in Jenkins? -- You received this message

Re: ScheduleBuild2 and determining if job was never started.

2016-05-20 Thread 'Niksan' via Jenkins Users
( jobToTrigger)*.getFuture() newJobFuture = parameters!=null ? jobToTrigger.scheduleBuild2( 0, cause, parameters ) : jobToTrigger.scheduleBuild2( 0, cause ) return currentJobFutures.contains(newJobFuture) ? null : newJobFuture } On Friday, May 20, 2016 at 1:33:23 PM UTC+1, Niksan wrote: > &

Re: ScheduleBuild2 and determining if job was never started.

2016-05-20 Thread 'Niksan' via Jenkins Users
dding job ${job.task}") futureJobs.add( job ) } else { println("Job aleady queued") } It's doesn't look great for me, and I'll be suprised if there's not a better approach, but something is better than nothing I guess. On Friday, May 20, 2016 at 12:41:44 PM UTC+1, Ni

Re: ScheduleBuild2 and determining if job was never started.

2016-05-20 Thread 'Niksan' via Jenkins Users
Also, how is one supposed to getId() from a hudson.model.queue.FutureImpl exactly? On Thursday, May 19, 2016 at 8:09:22 PM UTC+1, Daniel Beck wrote: > > > > On 19.05.2016, at 15:37, 'Niksan' via Jenkins Users < > jenkins...@googlegroups.com > wrote: > > > > So

Re: ScheduleBuild2 and determining if job was never started.

2016-05-20 Thread 'Niksan' via Jenkins Users
in the queue, assume a refused. And of course hope the queue doesn't change between those operations. Wow. :) On Friday, May 20, 2016 at 10:33:08 AM UTC+1, Niksan wrote: > > I'm not sure under what circumstances an item merge occurs, but that would > be problematic, as it would b

Re: ScheduleBuild2 and determining if job was never started.

2016-05-20 Thread 'Niksan' via Jenkins Users
tarted, I guess with a mixture of cancel checks and what not could determine the actual cause. I'd have to run some tests to see what means what. On Thursday, May 19, 2016 at 8:09:22 PM UTC+1, Daniel Beck wrote: > > > > On 19.05.2016, at 15:37, 'Niksan' via Jenkins Users < > jen

ScheduleBuild2 and determining if job was never started.

2016-05-19 Thread 'Niksan' via Jenkins Users
So, you can fire jobs off in Groovy using ScheduleBuild2 which returns a future. By its nature, Jenkins will purge any duplicate build requests at some point. How can we tell given a future if that job was purged by Jenkins itself to know it never actually ran? Or does that future return that

Re: email-ext as build step

2016-05-04 Thread 'Niksan' via Jenkins Users
Cheers, although I'm not using pipeline and I guess this can;t be pulled out to just be put in a groovy script build step? On Friday, April 29, 2016 at 3:53:55 AM UTC+1, Craig Rodrigues wrote: > > Niksan, > > Take a look at this Pipeline script I wrote: > > > https://githu

Re: email-ext as build step

2016-04-28 Thread 'Niksan' via Jenkins Users
Well, the case I'm interested in is a conditional build step and to be notified that the step is going to happen. On Thursday, April 28, 2016 at 3:48:17 PM UTC+1, slide wrote: > > I've been planning on adding a build step for email-ext, I just haven't > had the time yet. If you have multiple

Re: Json and dynamic variables

2016-02-18 Thread 'Niksan' via Jenkins Users
> > Ah great, exactly what I was looking for, I also realised I'd also be > better parsing the string before parsing the JSON, rather than the other > way round, simplifies it a lot. :) > Thanks again. -- You received this message because you are subscribed to the Google Groups "Jenkins

Re: Json and dynamic variables

2016-02-18 Thread 'Niksan' via Jenkins Users
> > Thanks for that, I'm only interested in reading though, I came up with a > solution although I'm rusty with Groovy but it will make do until a better > approach appears. > This method enables me to write test json in the console for test purposes. def token1 = 'Replaced-Token1' def token2

Json and dynamic variables

2016-02-18 Thread 'Niksan' via Jenkins Users
I have a job which has a groovy script and inside there I have a JSON like array which I parse, I'd like to offload this array to a JSON file on disk but it contains some elements that are gathered from parameters for the job. What's the best way of injecting / replacing tokens in a JSON file

Re: "somecommand".execute()

2016-01-26 Thread Niksan
I'm trying to execute a system command on the server from a client and wait for its result, the syncronization was a side effect of using wait(), waitFor() is what I was after though, thanks. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group.

"somecommand".execute()

2016-01-21 Thread Niksan
When running a process on a slave using execute system groovy, what's the correct way to syncronise so a wait() can be performed on the process? def proc = "dir".execute() synchronized (proc) { proc.consumeProcessOutput(out, out) proc.wait(); } this just waits forever and not

lastSuccessful / lastFailed - how to stop these being updated?

2016-01-20 Thread Niksan
As the subject says, in concurrent builds, as the linking is non atomic, depending how many jobs you have running you get exceptions because multiple instances try to do the same operation. As with some if not most concurrent jobs, a last successful / failed makes no sense, so is there anyway

Re: nodelabel plugin and groovy

2016-01-20 Thread Niksan
The matrix job differs in its workspace layout so doesn't play ball, a square peg for a round hole. -- 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

Re: nodelabel plugin and groovy

2016-01-20 Thread Niksan
Parameters matter, the fix is obvious in hindsight. new StringParameterValue( 'Distribution_Label', node ), should be new LabelParameterValue( 'Distribution_Label', node ), Happy days \o/ -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group.

nodelabel plugin and groovy

2016-01-19 Thread Niksan
I'm trying to control where jobs are run from a groovy script, it's an edge case that I have to run on all nodes in a label rather than what's free. I was hoping I could use the nodelabel plugin to do this. On my slave job I have a label parameter, named and defaults to my label that a lot of

Jenkins remote API

2015-10-15 Thread Niksan
I spent a while doing some cool execution scripts in groovy to change the display name for a job concurrently whilst executing a windows batch file. Unfortunately I was bit by the system groovy script only executing on the server. As I only want to change the display name for a job, so the

Re: Jenkins remote API

2015-10-15 Thread Niksan
Aha, maybe this will work. https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console -- 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

groovy postbuild launcher

2015-10-02 Thread Niksan
Does anyone know if you can get at the launcher via groovy postscript, so one can do launcher.launch rather than reinvent the wheel and do string.execute()? -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and

Groovy post step

2015-09-30 Thread Niksan
Anyone know what this is? org.codehaus.groovy.runtime.DefaultGroovyMethods$7@1bdb2d5 I'm trying to iterate through a regex matcher and having no joy at all. Or is there a better way of being able to access the results from a regex matcher, I've tried using .collect() and lots of other

Re: Getting a build step error code

2015-09-30 Thread Niksan
I resorted to using a bit of regex. *shudder* :) -- 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. To view this

Getting a build step error code

2015-09-29 Thread Niksan
Is there anyway, via a Groovy post step if that's possible, to get an exit code number that a build step yielded causing a Jenkins job to fail? I'm interested in getting a return code from a windows batch step so I can use that info to change the display name for a Jenkins job. -- You

email-ext 2.40 #x2714 problem

2015-04-30 Thread Niksan
I've just updated email-ext to 2.40 with the hope it fixes issues with sending text with replaced with quot etc. This seems fixed but now has problem with ampersands. #x2714 (which should and used to display a tick in email) is replaced by amp;#x2714 Does anyone know of work around or is

Re: email-ext 2.40 #x2714 problem

2015-04-30 Thread Niksan
Niksan sumo...@googlemail.com javascript: wrote: I've just updated email-ext to 2.40 with the hope it fixes issues with sending text with replaced with quot etc. This seems fixed but now has problem with ampersands. #x2714 (which should and used to display a tick in email) is replaced

Re: Failing to update jenkins.war

2015-04-08 Thread Niksan
with 1.608 not being available for download properly yet so, if true, that might be the cause of the issue. Richard On 1:45AM, Wed, 8/04/2015 Niksan sumo...@googlemail.com javascript: mailto:sumo...@googlemail.com javascript: wrote: I'm currently on 1.598 and trying

Failing to update jenkins.war

2015-04-07 Thread Niksan
I'm currently on 1.598 and trying to auto update to 1.608 but it stays on pending for jenkins.war for a while with the following output. hudson.util.IOException2: Failed to download from http://updates.jenkins-ci.org/download/war/1.608/jenkins.war (redirected to:

Re: email-ext and img data-inline not working.

2015-01-29 Thread Niksan
Niksan sumo...@googlemail.com javascript: wrote: Is there anything special that needs setting somewhere for this to work? Using the sample at the bottom of CssInlinerTest.java where the location is using something that expands to the file location on disk orusing the jenkins http://host

email-ext and img data-inline not working.

2015-01-28 Thread Niksan
Is there anything special that needs setting somewhere for this to work? Using the sample at the bottom of CssInlinerTest.java where the location is using something that expands to the file location on disk orusing the jenkins http://host/userContent/image.png just puts the img src=location

Re: Security permissions wiped after server restart

2014-12-01 Thread Niksan
I've see the exact same, you're not alone, I thought it fully wiped out my accounts but I didn't re-enable Jenkins internal database so my post (or the second part of it at least) is irrelevant. https://groups.google.com/forum/#!topic/jenkinsci-users/E42NFkiHCPM On Monday, December 1, 2014

Re: Security permissions wiped after server restart

2014-12-01 Thread Niksan
The annoying thing is, the permissions still exist in config.xml, it's almost as if Jenkins is just not reading them in at all when rebooting the server. On Monday, December 1, 2014 3:00:39 PM UTC, Scribe wrote: Thanks Niksan, Glad I'm not the only one. I'll check the status of the ticket

Users security lost after Jenkins restart

2014-11-25 Thread Niksan
I'm not sure if anyone else has ever seen this, but I have had it happen the last two times I've restarted the Jenkins server. I'm currently on v1.589 and it does it here. I've set up four user accounts who have full permissions set and anonymous just has read set. This is all done via Jenkins

Re: Remote root directory vs Use custom workspace for a job

2014-10-17 Thread Niksan
I mean, what is it that needs to use the full absolute path or even its own working directory name? The four character path constraint. C:\\All My sub dirs here This will work. C:\A\All My sub dirs here This will not. This is a OS/Tools/Third party constraint, I don't see how not

Re: Remote root directory vs Use custom workspace for a job

2014-10-17 Thread Niksan
Ok, I'm going to knock this one on the head. Thanks for trying to help. -- 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

Re: Special Build Number Format

2014-10-17 Thread Niksan
This should be trivial with a small groovy script, build today can be easily worked out by traversing builds. -- 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

Remote root directory vs Use custom workspace for a job

2014-10-16 Thread Niksan
So I have a job that sets to use a custom workspace with a directory of C:\Chk, now, I'd like this directory to persist on a slave too on another machine, but as you have to put a remote root directory you end up with the slave creating folder along the lines of C:\C\Chk. What's the correct

Re: Remote root directory vs Use custom workspace for a job

2014-10-16 Thread Niksan
Oddly enough, if I set custom workspace and remote root both to C:\Chk this works as intended, but that limits one job per node. :/ -- 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

Re: Remote root directory vs Use custom workspace for a job

2014-10-16 Thread Niksan
No, if you run other jobs on that node they should be created as Unfortunately, my jobs are path length volatile, currently four characters (I know, some constraints just suck). The jobs also have to be synchronous, as in I can have two of them running together on a singular machine. If

Re: Remote root directory vs Use custom workspace for a job

2014-10-16 Thread Niksan
That depends on what you mean by the rest of the path, the master suffers from the same issue, I suppose one way would be to have the master not perform any builds and somehow leverage the hudson.model.Slave.workspaceRoot token and omit the workspace override on the job, if any of that makes

Can't get slaves running

2014-10-13 Thread Niksan
I'm currently on v1.583 and the same happened on v1.571 while using the launch agent from browser on slave option I cannot get it to work, all the slaves I'd like to run are on external machines to the server and I get the following Java error when running. java.lang.NullPointerException

Re: Can't get slaves running

2014-10-13 Thread Niksan
Ok, so installing Java8 JRE on the client machines made this work, who knew. :) -- 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

Re: Problems with email-ext messages after Jenkins upgrade, with both Perforce and Git SCM jobs

2014-06-17 Thread Niksan
Hi Jim, This is what I used before I submitted the PR, just put the following as a system groovy script build step.. import hudson.model.* /// // calculate all change lists and commiters of all

Re: Contributing fixes to plugins (perforce)

2014-04-25 Thread Niksan
Nevermind, I decided to give Intellij CE a go, and I don't know what kind of voodoo magic it does, but it makes things a lot simpler. :) -- You received this message because you are subscribed to the Google Groups Jenkins Users group. To unsubscribe from this group and stop receiving emails

Re: Contributing fixes to plugins (perforce)

2014-04-23 Thread Niksan
23.04.2014 um 14:25 schrieb Niksan sumo...@googlemail.comjavascript: : -- 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

Re: Contributing fixes to plugins (perforce)

2014-04-23 Thread Niksan
1.7? BTW: you would get more answers in the dev-list (CC) Am 23.04.2014 um 14:25 schrieb Niksan sumo...@googlemail.comjavascript: : -- You received this message because you are subscribed to the Google Groups Jenkins Users group. To unsubscribe from this group and stop receiving emails

Best way of pulling data to put insde email-ext

2014-04-17 Thread Niksan
I'm currently trying to get a change number from the last successful build, I can do this as a URL but I'm wondering if there's a more simple approach to getting this info to make it part of an email-ext mail so I can provide the last successful changelist along with the broken one.

Re: Best way of pulling data to put insde email-ext

2014-04-17 Thread Niksan
I should probably add that I'm running on a Windows machine if that makes any difference. -- 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

Re: Best way of pulling data to put insde email-ext

2014-04-17 Thread Niksan
While I was waiting for a reply I started googling like a nut job, doesn't help it's my first day with Java either. :) However I managed to rustle up something up if it's of any use to anyone else. Cheers. import hudson.model.* def lastWorkingBuildCS =

Perforce root into execute windows batch command

2014-04-03 Thread Niksan
Is there anyway to get the root from a perforce workspace so that %WORKSPACE% in the windows batch command maps to it, as when you set it not to allow jenkins to create a workspace there's no way to tell where your source actually is. At the moment %WORKSPACE% is currently mapped to