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
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 StringPa
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 receiving
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 system
> scrip
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
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 becau
And it turns out that code was splodge, man, so tedious. :D
Anyhoo, for reference and if anyone else finds it useful, the correct, more
lightweight solution is
def triggerJob( jobToTrigger, cause, parameters ) {
def currentJobFutures = Jenkins.getInstance().getQueue().getItems(
jobToTrigger
y 20, 2016 at 12:41:44 PM UTC+1, Niksan wrote:
>
> 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'
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:
> >
&g
I did some tests and it appears to merge, or rather, schedulebuild2 just
returns the instance of the already queued job from a previous
scheduledbuild2 as you suggested, that's incredibly annoying, so I guess
one has to take a snapshot of the build queue then schedulebuild2, if it's
already in
ll, it never
started, 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' v
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
github.com/freebsd/freebsd-ci/blob/master/scripts/build/build-test.groovy#L233
>
> which sends e-mail as a post-build step in case of failures.
>
> --
> Craig
>
>
> On Thu, Apr 28, 2016 at 7:44 AM, 'Niksan' via Jenkins Users <
> jenkins...@googlegroups.com >
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 job
As the email-ext plugin itself doesn't do it being a post-build step, is
there anything similar that can send an email as a build step? I'm trying
to avoid smashing a walnut with a sledgehammer, as in, having multiple jobs
to deal with this etc.
--
You received this message because you are su
>
> 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 Us
>
> 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 =
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 th
18 matches
Mail list logo