Re: [Declarative Pipeline] currentBuild.result is not set

2017-02-11 Thread Dan Tran
Thanks that helps

-Dan

On Saturday, February 11, 2017 at 10:42:02 PM UTC-8, Andrew Bayer wrote:
>
> Yup - currentBuild.result isn't actually set until either something is 
> explicitly setting the status (like a failure or unstable) or the build 
> ends, at which point it's set to success if still null. So basically null 
> is equivalent to success.
>
> A.
>
> On Sat, Feb 11, 2017 at 9:49 AM Dan Tran  
> wrote:
>
>>
>> Hi
>>
>> It seems currentBuild.result is not set at post stages, here is the 
>> snippet. is it normal?  it always return null for my case
>>
>>stages {
>>   ...
>> }
>>
>> post {
>>
>> always {
>> script {
>>wrap([$class: 'BuildUser']) {
>>   mail to: "${env.BUILD_USER_EMAIL}",
>>   subject: "${env.BUILD_URL} 
>> ${currentBuild.result}",
>>   body: "${env.BUILD_URL} completed"
>>}
>>}
>> }
>>
>> }
>>
>> Thanks
>>
>> -Dan
>>
>> -- 
>> 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 .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/ce8101b2-6a0b-4581-a39b-5b831339d62f%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/89963e6f-2f5e-4926-afdb-477758f12bb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Declarative Pipeline] currentBuild.result is not set

2017-02-11 Thread Andrew Bayer
Yup - currentBuild.result isn't actually set until either something is
explicitly setting the status (like a failure or unstable) or the build
ends, at which point it's set to success if still null. So basically null
is equivalent to success.

A.

On Sat, Feb 11, 2017 at 9:49 AM Dan Tran  wrote:

>
> Hi
>
> It seems currentBuild.result is not set at post stages, here is the
> snippet. is it normal?  it always return null for my case
>
>stages {
>   ...
> }
>
> post {
>
> always {
> script {
>wrap([$class: 'BuildUser']) {
>   mail to: "${env.BUILD_USER_EMAIL}",
>   subject: "${env.BUILD_URL}
> ${currentBuild.result}",
>   body: "${env.BUILD_URL} completed"
>}
>}
> }
>
> }
>
> Thanks
>
> -Dan
>
> --
> 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 discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/ce8101b2-6a0b-4581-a39b-5b831339d62f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPbPdOaY5mpuqznq7nLTPnkm6t_7JEtfoa4iNaNVGkH%3Dp1eKiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multibranch pipeline - source code present but .git file missing

2017-02-11 Thread Mark Waite
Sharan,

Daniel was trying to tell you that you're misunderstanding what is a
workspace and what isn't a workspace.

The place where you're finding the Jenkinsfile is a temporary holding
location that exists for the purpose of reading the Jenkinsfile.  It is not
a workspace.  It is not a place where you should expect to find the rest of
your code.  At the moment, that temporary holding location happens to also
include other files, but that is more an accident of the nature of git than
it is a capability on which you can rely.

In order to use your source code in a Jenkins pipeline, you need to
checkout that source code in one of the early stages of your pipeline.  The
examples you've shared don't seem to include a "checkout scm" step, so you
have no sources to use.

For examples of the syntax of "checkout scm", you can use the "Pipeline
Syntax" hyperlink on the left of pipeline job pages.

Mark Waite

On Sat, Feb 11, 2017 at 7:08 AM Sharan Basappa 
wrote:

> Daniel,
>
> Don't try to be clever here. `checkout scm`.
>
> You are giving me more credit than I deserve.
>
> I really don't understand how source files from Git can appear in the
> workspace and .git dir is missing.
> In fact, for all the source files corresponding to every branch, there is
> no .git dir.
> I have seen this issue only when I started using multibranch pipeline and
> not with pipeline or other build job types.
> Also, in this case alone, I am using Jenkinsfile driven build steps
>
>
> On Saturday, 11 February 2017 15:16:23 UTC+5:30, Daniel Beck wrote:
>
>
> > On 11.02.2017, at 05:02, Sharan Basappa  wrote:
> >
> > 3) I am not checking out any repository explicitly in my Jenkinsfile - I
> still find source code in the workspace through
>
> That's probably the reason, and the reason it's in a wrong directory.
> Don't try to be clever here. `checkout scm`.
>
> --
> 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 discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/eebf0cb3-d3ec-4298-bef9-8ed3baa87bb8%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtH7ZFbjimDGXrGczp3DHDYYSaFc96FmKv%3D8VJ8B68hH%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Declarative Pipeline] currentBuild.result is not set

2017-02-11 Thread Dan Tran

Hi

It seems currentBuild.result is not set at post stages, here is the 
snippet. is it normal?  it always return null for my case

   stages {
  ...
}

post {

always {
script {
   wrap([$class: 'BuildUser']) {
  mail to: "${env.BUILD_USER_EMAIL}",
  subject: "${env.BUILD_URL} 
${currentBuild.result}",
  body: "${env.BUILD_URL} completed"
   }
   }
}

}

Thanks

-Dan

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ce8101b2-6a0b-4581-a39b-5b831339d62f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: sh pipeline step started to fail after update to 2.42

2017-02-11 Thread John Mellor
After downgrading the durable tasks pluginto fix this problem, a manual 
reboot is required to actually get pipelines functional again.  Thanks, 
Daniel !

On Friday, 10 February 2017 17:08:25 UTC-5, Daniel Beck wrote:
>
>
> > On 10.02.2017, at 21:40, John Mellor  
> wrote: 
> > 
> > Now what?  All pipelines a inoperable at this point. 
>
> I linked to JENKINS-41339 earlier, which mentions solutions in the 
> comments. 
>
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d55059c4-e677-45f5-918d-99bab53c5358%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: EnvInject - groovy script in Jenkins 2.x

2017-02-11 Thread Giulio Pulina
Hi, 

did you manage to solve this issue? I'm stuck with a similar setup and 
similar error.. 

Thanks in advance
Giulio

Il giorno giovedì 28 luglio 2016 23:43:16 UTC+2, Simona Avornicesei ha 
scritto:
>
> A new update. I fixed the "The class 'FileSearch' has an incorrect 
> modifier static." - the static class must be embedded in  another class. 
> Here's 
> the gist 
> .
>
> Now I'm left with 2 other issues:
> 1. at build time (isDebugMode = false)  Thread.currentThread()?.executable 
> returns null. Always. I think it's something related to the job running on 
> the slave but I have no idea with what should I replace it to make it work.
> 2. if the script is run (from job or from Scriptler) with isDebugMode = 
> true, the remote communication fails with:
>
> FATAL: remote file operation failed: 
> d:\jenkins\workspace\My_Project_Name/Src/SolutionInfo.cs at 
> hudson.remoting.Channel@1b37fe1:win_01: java.io.IOException: Remote call on 
> win_01 failedjava.io.IOException 
> : remote 
> file operation failed: 
> d:\jenkins\workspace\My_Project_Name/Src/SolutionInfo.cs at 
> hudson.remoting.Channel@1b37fe1:win_01: java.io.IOException: Remote call on 
> win_01 failed
>   at hudson.FilePath.act(FilePath.java:1014) 
> 
>   at hudson.FilePath.act(FilePath.java:996) 
> 
>   at hudson.FilePath$act$1.call(Unknown Source)
> [...]
>
> java.io.IOException: Remote call on win_01 failed
>
> [...]
>
> java.lang.Error: Failed to deserialize the Callable object.
>
> [...]
>
> java.lang.IllegalArgumentException: Unable to locate class file for class 
> FileParser$FileSearch
>   at hudson.remoting.Which.classFileUrl(Which.java:60)
>   at 
> hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch4(RemoteClassLoader.java:775)
>   at 
> hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch3(RemoteClassLoader.java:803)
>   at sun.reflect.GeneratedMethodAccessor2256.invoke(Unknown Source)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>   at java.lang.reflect.Method.invoke(Unknown Source)
>   at 
> hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:884)
>   at hudson.remoting.Request$2.run(Request.java:332)
>
>
> I updated the slave.jar used on the slave machine and restarted the agent. 
> Both master and slave machines have Win 7 on them and are configured the 
> same (jenkins path, java version, etc).
> I also cannot replace the groovy script with something else because it's 
> evaluated by EnvInject.
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f29c837f-aec3-4ff3-8ff4-6dfd51166f42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multibranch pipeline - source code present but .git file missing

2017-02-11 Thread Sharan Basappa
Daniel,

Don't try to be clever here. `checkout scm`.

You are giving me more credit than I deserve. 

I really don't understand how source files from Git can appear in the 
workspace and .git dir is missing.
In fact, for all the source files corresponding to every branch, there is 
no .git dir.
I have seen this issue only when I started using multibranch pipeline and 
not with pipeline or other build job types.
Also, in this case alone, I am using Jenkinsfile driven build steps


On Saturday, 11 February 2017 15:16:23 UTC+5:30, Daniel Beck wrote:

>
> > On 11.02.2017, at 05:02, Sharan Basappa  > wrote: 
> > 
> > 3) I am not checking out any repository explicitly in my Jenkinsfile - I 
> still find source code in the workspace through 
>
> That's probably the reason, and the reason it's in a wrong directory. 
> Don't try to be clever here. `checkout scm`. 
>
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/eebf0cb3-d3ec-4298-bef9-8ed3baa87bb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Define parameters for a group of jobs

2017-02-11 Thread francesco desposito
Hello,
I want to group the jobs referring to a single project together. 
Then I would like to define some parameters at group level and I want that 
those parameters are automatically passed to the jobs belonging to that 
group.
For example I want to create a group P1 with jobs a1, b1, c1. Then I define 
a parameter x for P1. I would like that x is automatically defined for the 
jobs a1, b1, c1.

Is that possible?

Thanks 

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/22d8816b-881c-48b6-be2b-f031e9b2ee48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multibranch pipeline - source code present but .git file missing

2017-02-11 Thread Daniel Beck

> On 11.02.2017, at 05:02, Sharan Basappa  wrote:
> 
> 3) I am not checking out any repository explicitly in my Jenkinsfile - I 
> still find source code in the workspace through

That's probably the reason, and the reason it's in a wrong directory. Don't try 
to be clever here. `checkout scm`.

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9BAD4801-B6A0-419C-995A-66AE5C416F67%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.