Pipeline when condition issue

2018-08-28 Thread MDKF
Hi All,
 I have the following pipeline. I don't expect the steps in the when 
condition to run, but they are. Can anyone tell me what i'm doing wrong? (I 
know using an expression instead of a simple equals is overkill, but this 
is a simplified example to show my issue)
-Michael

pipeline {

 // Discarded: Promote Builds When...

 agent any
 environment {
Development = true
}
 stages {
stage('test') {
when {
not {
expression {
Development == ~/(?i)(1|Y|YES|T|TRUE|ON|RUN)/
}
}
   }
   steps {
   echo 'Development is false'
}
 }
 }
}

-- 
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/f76ece7d-c962-4914-bdbd-c8addfb58ea9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Active Choices Plugin populated via ssh?

2018-08-28 Thread Robert Nicholson
Can Active Choices Plugin support populating itself using ssh or can it only 
read a flat file?

-- 
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/C7D46A6D-DA4D-455C-B43B-3BA433BE4549%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Email notification based on build log

2018-08-28 Thread debayan chatterjee
Hi Experts,
I would like to send notification email based on the build log for a 
freestyle project. For example if ORA- is present in the build log email 
subject will be 'Job failed' and if ORA- is not present then email subject 
will be 'Job succeeded'. Can you please suggest a method to implement this.

-- 
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/0b07c00b-b45d-4f93-a195-5cb06bda60a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


multi-branch pipeline / kubernetes stage probem

2018-08-28 Thread Gabe Nydick
My Jenkinsfile is below...

There are 3 containers defined, each with their appropriate docker image.
There are 3 stages defined, each one exclusively uses one of the containers.

While exec'd into all of the containers, each one of them have a

workspace/@/durable-/script.sh

the contents of that script in all three containers is the script from the
stage called 'Create Docker Images'.

When that stage completes, jenkins moves on to the next stage, but then the
durable- directory is gone. I then get the following error,
which makes sense.

sh: 
/home/jenkins/workspace/h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ@tmp/durable-170e31a9/script.sh:
not found



Did I author the Jenkinsfile incorrectly or is this a bug in the pipeline?



def label = "jenkins-builder-${UUID.randomUUID().toString()}"

podTemplate(label: label, inheritFrom: 'jenkins-builder', containers: [
  containerTemplate(name: 'kubectl', image: '', command:
'cat', ttyEnabled: true),
  containerTemplate(name: 'helm', image: '', command: 'cat',
ttyEnabled: true),
  containerTemplate(name: 'jnlp', image: '', command: 'cat',
ttyEnabled: true)
],
  volumes: [
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath:
'/var/run/docker.sock')
  ]) {
  node(label) {
def myRepo = checkout scm
def gitCommit = myRepo.GIT_COMMIT
def gitBranch = myRepo.GIT_BRANCH
def shortGitCommit = "${gitCommit[0..10]}"
def previousGitCommit = sh(script: "git rev-parse ${gitCommit}~",
returnStdout: true)

stage('Create Docker images') {
  container('jenkins-agent') {
sh """
  \$(aws ecr get-login --no-include-email --region=us-west-2 |
sed 's/-e none//')
  docker build -t :${gitCommit} . -f base.Dockerfile
  docker push :${gitCommit}
  """
  }
}
stage('Run kubectl') {
  container('kubectl') {
sh "kubectl get pods"
  }
}
stage('Run helm') {
  container('helm') {
sh "helm list"
  }
}
  }
}

-- 
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/CACTWNKBkGhor-cLVO_oFNCN8hp-X7r%2BiK6dDcJowvGTyAsOLkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: "download" button does nothing

2018-08-28 Thread Slide
It takes you to the "Download" page. It's the same header if you go to just
https://jenkins.io.



On Tue, Aug 28, 2018 at 3:56 PM Roger Pack  wrote:

> As a note, on this page:
> https://jenkins.io/download/
> Clicking the nice red "download" button near the top seems...to do nothing.
> Cheers!
>
> --
> 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/77d40783-6203-42ac-a147-d1e5cd2a323c%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/CAPiUgVc06gdO5EJWU68uRk8bmpcZOWX9NRCHVrW7FQ09MteDEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


restart is obscured

2018-08-28 Thread Roger Pack
As a note, I would have expected in the "system configuration" an option to 
"restart" jenkins.
There is an option to "Prepare for shutdown" but not one to actually do the 
deed.  It's a bit confusing...to beginners it's "shouldn't there be an 
option somewhere in the UI to restart?"
Today you have to google it, then figure out which endpoint you want, etc...
Cheers!
-roger-

-- 
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/7e443475-9d77-4bea-b322-dc63d9167ff2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


"uninstallation pending" for plugins

2018-08-28 Thread Roger Pack
Just a usability suggestion.

As a note, when you click "uninstall" to a plugin it says "uninstallation 
pending" where the uninstall button was before.
But it gives you no further instructions.
Suggestion/feature request: change text to say "uninstallation pending 
restart" to make it clearer, or show a popup "uninstallation will occur at 
next restart."
Cheers!

-- 
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/43f0b401-3056-4f52-ada1-e7c84c1250bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


"download" button does nothing

2018-08-28 Thread Roger Pack
As a note, on this page:
https://jenkins.io/download/
Clicking the nice red "download" button near the top seems...to do nothing.
Cheers!

-- 
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/77d40783-6203-42ac-a147-d1e5cd2a323c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: working kubernetes cloud not available in multi-branch pipeline

2018-08-28 Thread Gabe Nydick
OK, so this is what I have as a POC. I don't see why the pods i'm creating
are called 'jenkins-slave' when the pod template i'm inheriting has the
pods named 'jenkins-builder'

def label = "jenkins-builder-${UUID.randomUUID().toString()}"

podTemplate(label: label, inheritFrom: 'jenkins-builder', containers: [
  containerTemplate(name: 'kubectl', image: '', command:
'cat', ttyEnabled: true),
  containerTemplate(name: 'helm', image: '', command: 'cat',
ttyEnabled: true),
  containerTemplate(name: 'jenkins-agent', image: '', command:
'cat', ttyEnabled: true)
],
  volumes: [
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath:
'/var/run/docker.sock')
  ]) {
  node(label) {
def myRepo = checkout scm
def gitCommit = myRepo.GIT_COMMIT
def gitBranch = myRepo.GIT_BRANCH
def shortGitCommit = "${gitCommit[0..10]}"
def previousGitCommit = sh(script: "git rev-parse ${gitCommit}~",
returnStdout: true)

stage('Create Docker images') {
  container('jenkins-agent') {
sh """
  \$(aws ecr get-login --no-include-email --region=us-west-2 |
sed 's/-e none//')
  docker build -t :${gitCommit} . -f base.Dockerfile
  docker push :${gitCommit}
  """
  }
}
stage('Run kubectl') {
  container('kubectl') {
sh "kubectl get pods"
  }
}
stage('Run helm') {
  container('helm') {
sh "helm list"
  }
}
  }
}



On Tue, Aug 28, 2018 at 1:10 PM, Carlos Sanchez  wrote:

> It depends on what are you trying to do which is not clear. If you are
> building a pipeline job you need to use
>
> node(label) {}
> or in declarative
> agent { label 'my-defined-label' }
>
> or use the k8s plugin pipeline capabilities
>
> see
> https://wiki.jenkins.io/display/JENKINS/Distributed+
> builds#Distributedbuilds-Usinglabels
> https://jenkins.io/doc/book/pipeline/syntax/#agent
> https://github.com/jenkinsci/kubernetes-plugin/
>
>
> On Tue, Aug 28, 2018 at 10:02 PM Gabe Nydick  wrote:
>
>> Oh, and which plugin, is this a kubernetes plugin issue or multi-branch?
>>
>> On Tue, Aug 28, 2018 at 1:01 PM, Gabe Nydick  wrote:
>>
>>> I don't see where I can add labels to my job.
>>>
>>> On Tue, Aug 28, 2018 at 1:00 PM, Gabe Nydick  wrote:
>>>
 Exactly that section. So I have to add labels to my multi-branch job to
 match the labels in the template?

 On Tue, Aug 28, 2018 at 12:53 PM, Carlos Sanchez 
 wrote:

> > When I configure a multi-branch pipeline, the Kubernetes cluster
> section
>
> are you talking about the section that says "Allow pipeline support
> for the following restricted Kubernetes Clouds"
> that's only for security restrictions
>
> You have to check what labels do you have defined in your pod template
> config and what labels your job uses. Check the logs for more detailed
> info, see debugging section in the plugin readme
>
>
> On Tue, Aug 28, 2018 at 8:54 PM Gabe Nydick  wrote:
>
>> I have a successfully configured kubernetes cluster that runs my
>> build jobs. When I configure a multi-branch pipeline, the Kubernetes
>> cluster section just has ' -- none -- '. The multi-branch pipeline still
>> runs, but it has errors that are in a different topic email, so I'll keep
>> that there, but instead of using the pod template that runs all of the
>> freestyle jobs, this one uses some other template that I can't find, 
>> maybe
>> it's a default in the plugin code.
>>
>> 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/CACTWNKCvtmNXpbG-8uA3A4HPSq%
>> 3DuXCztpiXFpoS3XRUy1pt2FQ%40mail.gmail.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/CALHFn6OTvFjB7KT_ZjKkUmHgzGkAHbw1cVp5fKBfB5EYTp
> _egw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


>>>
>> --
>> You received this message because you are subscribed to the 

Re: working kubernetes cloud not available in multi-branch pipeline

2018-08-28 Thread Carlos Sanchez
It depends on what are you trying to do which is not clear. If you are
building a pipeline job you need to use

node(label) {}
or in declarative
agent { label 'my-defined-label' }

or use the k8s plugin pipeline capabilities

see
https://wiki.jenkins.io/display/JENKINS/Distributed+builds#Distributedbuilds-Usinglabels
https://jenkins.io/doc/book/pipeline/syntax/#agent
https://github.com/jenkinsci/kubernetes-plugin/


On Tue, Aug 28, 2018 at 10:02 PM Gabe Nydick  wrote:

> Oh, and which plugin, is this a kubernetes plugin issue or multi-branch?
>
> On Tue, Aug 28, 2018 at 1:01 PM, Gabe Nydick  wrote:
>
>> I don't see where I can add labels to my job.
>>
>> On Tue, Aug 28, 2018 at 1:00 PM, Gabe Nydick  wrote:
>>
>>> Exactly that section. So I have to add labels to my multi-branch job to
>>> match the labels in the template?
>>>
>>> On Tue, Aug 28, 2018 at 12:53 PM, Carlos Sanchez 
>>> wrote:
>>>
 > When I configure a multi-branch pipeline, the Kubernetes cluster
 section

 are you talking about the section that says "Allow pipeline support
 for the following restricted Kubernetes Clouds"
 that's only for security restrictions

 You have to check what labels do you have defined in your pod template
 config and what labels your job uses. Check the logs for more detailed
 info, see debugging section in the plugin readme


 On Tue, Aug 28, 2018 at 8:54 PM Gabe Nydick  wrote:

> I have a successfully configured kubernetes cluster that runs my build
> jobs. When I configure a multi-branch pipeline, the Kubernetes cluster
> section just has ' -- none -- '. The multi-branch pipeline still runs, but
> it has errors that are in a different topic email, so I'll keep that 
> there,
> but instead of using the pod template that runs all of the freestyle jobs,
> this one uses some other template that I can't find, maybe it's a default
> in the plugin code.
>
> 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/CACTWNKCvtmNXpbG-8uA3A4HPSq%3DuXCztpiXFpoS3XRUy1pt2FQ%40mail.gmail.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/CALHFn6OTvFjB7KT_ZjKkUmHgzGkAHbw1cVp5fKBfB5EYTp_egw%40mail.gmail.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/CACTWNKBZ%2BaEVZL_JdpY8a%2B59m8MTBgWtMtVvQCsmFpT0r8y7Tg%40mail.gmail.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/CALHFn6PwNu7z523OTQCavSBne%2Bcpq1WQHwxRus-w-5J%3DKnCBpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: working kubernetes cloud not available in multi-branch pipeline

2018-08-28 Thread Gabe Nydick
Oh, and which plugin, is this a kubernetes plugin issue or multi-branch?

On Tue, Aug 28, 2018 at 1:01 PM, Gabe Nydick  wrote:

> I don't see where I can add labels to my job.
>
> On Tue, Aug 28, 2018 at 1:00 PM, Gabe Nydick  wrote:
>
>> Exactly that section. So I have to add labels to my multi-branch job to
>> match the labels in the template?
>>
>> On Tue, Aug 28, 2018 at 12:53 PM, Carlos Sanchez 
>> wrote:
>>
>>> > When I configure a multi-branch pipeline, the Kubernetes cluster
>>> section
>>>
>>> are you talking about the section that says "Allow pipeline support for
>>> the following restricted Kubernetes Clouds"
>>> that's only for security restrictions
>>>
>>> You have to check what labels do you have defined in your pod template
>>> config and what labels your job uses. Check the logs for more detailed
>>> info, see debugging section in the plugin readme
>>>
>>>
>>> On Tue, Aug 28, 2018 at 8:54 PM Gabe Nydick  wrote:
>>>
 I have a successfully configured kubernetes cluster that runs my build
 jobs. When I configure a multi-branch pipeline, the Kubernetes cluster
 section just has ' -- none -- '. The multi-branch pipeline still runs, but
 it has errors that are in a different topic email, so I'll keep that there,
 but instead of using the pod template that runs all of the freestyle jobs,
 this one uses some other template that I can't find, maybe it's a default
 in the plugin code.

 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/ms
 gid/jenkinsci-users/CACTWNKCvtmNXpbG-8uA3A4HPSq%3DuXCztpiXFp
 oS3XRUy1pt2FQ%40mail.gmail.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/ms
>>> gid/jenkinsci-users/CALHFn6OTvFjB7KT_ZjKkUmHgzGkAHbw1cVp5fKB
>>> fB5EYTp_egw%40mail.gmail.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/CACTWNKBZ%2BaEVZL_JdpY8a%2B59m8MTBgWtMtVvQCsmFpT0r8y7Tg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: working kubernetes cloud not available in multi-branch pipeline

2018-08-28 Thread Gabe Nydick
I don't see where I can add labels to my job.

On Tue, Aug 28, 2018 at 1:00 PM, Gabe Nydick  wrote:

> Exactly that section. So I have to add labels to my multi-branch job to
> match the labels in the template?
>
> On Tue, Aug 28, 2018 at 12:53 PM, Carlos Sanchez 
> wrote:
>
>> > When I configure a multi-branch pipeline, the Kubernetes cluster section
>>
>> are you talking about the section that says "Allow pipeline support for
>> the following restricted Kubernetes Clouds"
>> that's only for security restrictions
>>
>> You have to check what labels do you have defined in your pod template
>> config and what labels your job uses. Check the logs for more detailed
>> info, see debugging section in the plugin readme
>>
>>
>> On Tue, Aug 28, 2018 at 8:54 PM Gabe Nydick  wrote:
>>
>>> I have a successfully configured kubernetes cluster that runs my build
>>> jobs. When I configure a multi-branch pipeline, the Kubernetes cluster
>>> section just has ' -- none -- '. The multi-branch pipeline still runs, but
>>> it has errors that are in a different topic email, so I'll keep that there,
>>> but instead of using the pod template that runs all of the freestyle jobs,
>>> this one uses some other template that I can't find, maybe it's a default
>>> in the plugin code.
>>>
>>> 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/ms
>>> gid/jenkinsci-users/CACTWNKCvtmNXpbG-8uA3A4HPSq%3DuXCztpiXFp
>>> oS3XRUy1pt2FQ%40mail.gmail.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/ms
>> gid/jenkinsci-users/CALHFn6OTvFjB7KT_ZjKkUmHgzGkAHbw1cVp5fKB
>> fB5EYTp_egw%40mail.gmail.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/CACTWNKBEhLNNxHV1Z3j_N68o8UC90MdEnuqJ2g4qu5%3DskDbE%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: multi-branch pipeline, shell wrapper script fails

2018-08-28 Thread Gabe Nydick
I did while it was running and there were no symlinks. I might have timed
it wrong though, I saw that the content didn't show up right away. I'll try
again.

On Tue, Aug 28, 2018, 6:11 AM 'Björn Pedersen' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Hi,
> The too many levels of symbolic links normally hints to a symlink circle.
>
> Carefully check  the workspace folder (and parents) on the host machine.
>
> Björn
>
> Am Dienstag, 28. August 2018 11:58:46 UTC+2 schrieb ga...@ridezum.com:
>>
>> Here's the condensed output from the build job log...  It's Jenkins 2.140
>> with all of the latest plugins. It seems to be failing to start creating a
>> log while it wraps my shell script. Not sure how to debug this.
>>
>> [h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ]
>> Running shell script
>> + git rev-parse 78af875366ad95083bc70e1bf98ada278df9d751~
>> [Pipeline] stage
>> [Pipeline] { (Create Docker images)
>> [Pipeline] container
>> [Pipeline] {
>> [Pipeline] sh
>> [h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ]
>> Running shell script
>> sh: 1: touch: Too many levels of symbolic links
>> + source /usr/local/awscli/bin/activate
>> ++ deactivate nondestructive
>> .
>> .
>> .
>> .
>> e492023cc4f9: Layer already exists
>> cbda574aa37a: Layer already exists
>> 8451f9fe0016: Layer already exists
>> 858cd8541f7e: Layer already exists
>> a42d312a03bb: Layer already exists
>> sh: 1: touch: Too many levels of symbolic links
>> dd1eb1fd7e08: Layer already exists
>> e6a9d89abfe6: Pushed
>> sh: 1: touch: Too many levels of symbolic links
>> sh: 1: touch: Too many levels of symbolic links
>> sh: 1: touch: Too many levels of symbolic links
>> c78bbd2f18f1: Pushed
>> a795488c6995: Pushed
>> sh: 1: touch: Too many levels of symbolic links
>> sh: 1: touch: Too many levels of symbolic links
>> sh: 1: touch: Too many levels of symbolic links
>> sh: 1: touch: Too many levels of symbolic links
>> sh: 1: touch: Too many levels of symbolic links
>> sh: 1: touch: Too many levels of symbolic links
>> wrapper script does not seem to be touching the log file in
>> /home/jenkins/workspace/h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ@tmp
>> /durable-9be4cc24
>>
>> --
> 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/c60ec88e-8992-475d-a7bf-de7164bddb24%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/CACTWNKBKeXrMf518bb%2BGoatnmtS%3D5RbfU4n9VOiO6Hmpb7zcQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Unexpected behavior instantiating a class from dynamically loaded library

2018-08-28 Thread Hari Krishna Dara
I have a git project docker-build with the below class:

$ cat src/docker_build/DockerBuild.groovy

package docker_build

class DockerBuild {
def image
def steps

DockerBuild(steps) {
this.steps = steps
steps.docker.withRegistry('...', '...') {
image = steps.docker.image('...')
image.pull()
}
}
}

I tried to use the above class from a pipeline like this:

docker_build_lib = library(identifier: 'docker_build@master',
retriever: modernSCM( [$class: 'GitSCMSource', 
remote: '...', credentialsId: '...']))
docker_build = docker_build_lib.docker_build

pipeline {
agent "any"

stages {
stage("Init") {
steps {
script {
d = docker_build.DockerBuild.new(this)
echo "GOT: ${d}"
}
}
}
}
}

The output I get is something like this:

$ docker login -u "..." -p  ...
Login Succeeded
[Pipeline] {
[Pipeline] echo
in withRegistry closure
[Pipeline] }
[Pipeline] // withDockerRegistry
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] echo
GOT: org.jenkinsci.plugins.docker.workflow.Docker$Image@7e65907b

My question is, why is DockerBuild.new() returning an object of type 
Docker$Image instead of docker_build.DockerBuild? Something weird is going 
on with the constructor and I am unable to even diagnose it. The output 
from any echo/println statements that I put in the constructor get lost 
except those that that get executed before the withRegistry() call. In 
fact, the output from image.pull() also gets lost. In another pipeline 
where I am doing a pull within the Jenkinsfile, I see output like this:

+ docker pull ...
Using default tag: latest
latest: Pulling from ...
Digest: 
sha256:f767e25c35c6977a336c080f16bd9c63fcdc04c405eb984d1c178e273d0547b8
Status: Image is up to date for ...

I am just following the Loading libraries dynamically 

 
section and I do want to get this working with dynamically loaded libraries 
as I want to avoid the global static configuration that is associated with 
the @Library annotations. I would appreciate any help in diagnosing or 
getting this working.

-- 
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/6f136fed-d2a9-4157-8110-0c3397ecda90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to enable debug to get the line number of an error from JobScriptsSpec

2018-08-28 Thread Jeff Ippolito

So my jobdsl test is failing and the JobScriptsSpec won't give me the line 
number of where in my groovy file it is failing.  I ran the gradle job with 
the flags --stacktrace and --debug but it did not help.  Is there something 
in the JobScriptsSpec 
(https://github.com/jenkinsci/job-dsl-plugin/wiki/Testing-DSL-Scripts) that 
i can set to get the line number?


 com.mycompany.jobdsl.JobScriptsSpec > test script "microservices.groovy" 
FAILED
 Expected no exception to be thrown, but got 
'java.lang.ClassCastException'
 at 
spock.lang.Specification.noExceptionThrown(Specification.java:118)
 at com.mycompany.jobdsl.JobScriptsSpec.test script 
"#file.name"(JobScriptsSpec.groovy:52)
 
 Caused by:
 java.lang.ClassCastException: java.lang.Object cannot be cast to 
hudson.model.Describable
 at hudson.model.Descriptor.toMap(Descriptor.java:986)
 at hudson.util.DescribableList.toMap(DescribableList.java:151)
 at hudson.model.Project.getBuildWrappers(Project.java:148)
 at 
hudson.model.Project.createTransientActions(Project.java:252)
 at 
hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:731)
 at 
hudson.model.AbstractProject.onLoad(AbstractProject.java:323)
 at hudson.model.Project.onLoad(Project.java:97)
at hudson.model.Items.load(Items.java:372)
at hudson.model.ItemGroupMixIn$4.call(ItemGroupMixIn.java:280)
at hudson.model.ItemGroupMixIn$4.call(ItemGroupMixIn.java:278)
at hudson.model.Items.whileUpdatingByXml(Items.java:135)
at 
hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:278)
at jenkins.model.Jenkins.createProjectFromXML(Jenkins.java:3873)
at 
javaposse.jobdsl.plugin.JenkinsJobManagement.createNewItem(JenkinsJobManagement.java:502)
at 
javaposse.jobdsl.plugin.JenkinsJobManagement.createOrUpdateConfig(JenkinsJobManagement.java:136)
at 
javaposse.jobdsl.dsl.AbstractDslScriptLoader.extractGeneratedJobs_closure4(AbstractDslScriptLoader.groovy:194)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at 
javaposse.jobdsl.dsl.AbstractDslScriptLoader.extractGeneratedJobs(AbstractDslScriptLoader.groovy:187)
at 
javaposse.jobdsl.dsl.AbstractDslScriptLoader.extractGeneratedItems(AbstractDslScriptLoader.groovy:174)
at 
javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScripts_closure1(AbstractDslScriptLoader.groovy:61)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at 
javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScripts(AbstractDslScriptLoader.groovy:46)
at com.mycompany.jobdsl.JobScriptsSpec.test script 
"#file.name"(JobScriptsSpec.groovy:46)

-- 
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/5af807a8-0432-4f27-84a9-4ab55f0d7916%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: multi-branch pipeline, shell wrapper script fails

2018-08-28 Thread 'Björn Pedersen' via Jenkins Users
Hi, 
The too many levels of symbolic links normally hints to a symlink circle. 

Carefully check  the workspace folder (and parents) on the host machine.

Björn

Am Dienstag, 28. August 2018 11:58:46 UTC+2 schrieb ga...@ridezum.com:
>
> Here's the condensed output from the build job log...  It's Jenkins 2.140 
> with all of the latest plugins. It seems to be failing to start creating a 
> log while it wraps my shell script. Not sure how to debug this.
>
> [h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ]
>  
> Running shell script
> + git rev-parse 78af875366ad95083bc70e1bf98ada278df9d751~
> [Pipeline] stage
> [Pipeline] { (Create Docker images)
> [Pipeline] container
> [Pipeline] {
> [Pipeline] sh
> [h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ]
>  
> Running shell script
> sh: 1: touch: Too many levels of symbolic links
> + source /usr/local/awscli/bin/activate
> ++ deactivate nondestructive
> .
> .
> .
> .
> e492023cc4f9: Layer already exists
> cbda574aa37a: Layer already exists
> 8451f9fe0016: Layer already exists
> 858cd8541f7e: Layer already exists
> a42d312a03bb: Layer already exists
> sh: 1: touch: Too many levels of symbolic links
> dd1eb1fd7e08: Layer already exists
> e6a9d89abfe6: Pushed
> sh: 1: touch: Too many levels of symbolic links
> sh: 1: touch: Too many levels of symbolic links
> sh: 1: touch: Too many levels of symbolic links
> c78bbd2f18f1: Pushed
> a795488c6995: Pushed
> sh: 1: touch: Too many levels of symbolic links
> sh: 1: touch: Too many levels of symbolic links
> sh: 1: touch: Too many levels of symbolic links
> sh: 1: touch: Too many levels of symbolic links
> sh: 1: touch: Too many levels of symbolic links
> sh: 1: touch: Too many levels of symbolic links
> wrapper script does not seem to be touching the log file in 
> /home/jenkins/workspace/h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ@tmp/durable-9be4cc24
>
>

-- 
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/c60ec88e-8992-475d-a7bf-de7164bddb24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Restrict what jobs can run on nodes created by the Kubernetes plugin

2018-08-28 Thread Adam Dougal
Ah thanks for the quick reply. I'll take a look and have a play.


On Tuesday, August 28, 2018 at 11:42:01 AM UTC+1, Carlos Sanchez wrote:
>
> There is a way to restrict it by folder
> https://github.com/jenkinsci/kubernetes-plugin/pull/282/
>
> I realized that it was never added to the docs
>
>
> On Tue, Aug 28, 2018 at 12:31 PM Adam Dougal  > wrote:
>
>> Hi, Is there any way to restrict what jobs can run on nodes created using 
>> the Kubernetes plugin?
>>
>> I've seen the https://plugins.jenkins.io/job-restrictions but it does 
>> not look like this integrates with either the Kubernetes plugin or Jenkins 
>> pipelines. 
>>
>> Is this something that would be useful as a native feature of the 
>> Kubernetes plugin itself?
>>
>> -- 
>> 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/1b4eeba0-4002-4b18-8865-067a09cd4e45%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/194a80a2-3c50-4c7d-85bf-5bcd93842f0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Restrict what jobs can run on nodes created by the Kubernetes plugin

2018-08-28 Thread Adam Dougal
Hi, Is there any way to restrict what jobs can run on nodes created using 
the Kubernetes plugin?

I've seen the https://plugins.jenkins.io/job-restrictions but it does not 
look like this integrates with either the Kubernetes plugin or Jenkins 
pipelines. 

Is this something that would be useful as a native feature of the 
Kubernetes plugin itself?

-- 
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/1b4eeba0-4002-4b18-8865-067a09cd4e45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reg scanning the multi branch pipleline

2018-08-28 Thread keshav birla
Hi,

Greetings of the day

when i create  a new pr before going to declarative checkout  it is 
scanning but in my case it should not scan all the branches it should scan 
only changed branches and triggered the build.
Any help be great full to me

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/951b0a34-7eb3-48d3-95fa-0f512435f7e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


multi-branch pipeline, shell wrapper script fails

2018-08-28 Thread gabe
Here's the condensed output from the build job log...  It's Jenkins 2.140 
with all of the latest plugins. It seems to be failing to start creating a 
log while it wraps my shell script. Not sure how to debug this.

[h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ]
 
Running shell script
+ git rev-parse 78af875366ad95083bc70e1bf98ada278df9d751~
[Pipeline] stage
[Pipeline] { (Create Docker images)
[Pipeline] container
[Pipeline] {
[Pipeline] sh
[h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ]
 
Running shell script
sh: 1: touch: Too many levels of symbolic links
+ source /usr/local/awscli/bin/activate
++ deactivate nondestructive
.
.
.
.
e492023cc4f9: Layer already exists
cbda574aa37a: Layer already exists
8451f9fe0016: Layer already exists
858cd8541f7e: Layer already exists
a42d312a03bb: Layer already exists
sh: 1: touch: Too many levels of symbolic links
dd1eb1fd7e08: Layer already exists
e6a9d89abfe6: Pushed
sh: 1: touch: Too many levels of symbolic links
sh: 1: touch: Too many levels of symbolic links
sh: 1: touch: Too many levels of symbolic links
c78bbd2f18f1: Pushed
a795488c6995: Pushed
sh: 1: touch: Too many levels of symbolic links
sh: 1: touch: Too many levels of symbolic links
sh: 1: touch: Too many levels of symbolic links
sh: 1: touch: Too many levels of symbolic links
sh: 1: touch: Too many levels of symbolic links
sh: 1: touch: Too many levels of symbolic links
wrapper script does not seem to be touching the log file in 
/home/jenkins/workspace/h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ@tmp/durable-9be4cc24

-- 
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/666e18a0-6081-4e6a-8435-8c126b4c9e95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pass in a parameter/property specified by Jenkins job, not user

2018-08-28 Thread Adam Hardy
I think I can use env.JOB_BASE_NAME

Failing that I can give different jobs different script paths, and call 
other scripts with parameters.


Qiang Ma wrote on 26/08/18 15:20: 

> Hmm, JOB_NAME would be auto generated based on the branch name. 
>
>
>

-- 
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/abd12117-f1a8-4f57-ba64-67040cb346b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins - java.io.IOException: Pipeline: API v2.29 failed to load. - Error Message

2018-08-28 Thread gaurav pant
Hi Poovaraj,

You need to first update your jenkins to the v2.121 or later to run this
plugin as mentioned in the error.

Regards,

Gaurav Pant
On 28 Aug 2018 12:41, "Poovaraj Thangamariappan" 
wrote:

> Hi Team,
>
> I am getting below error message while installing Jenkins Plugins. Why is
> it showing below error message ? Please help me.
>
> Machine : Linux
> Jenkins Version : 2.107.1
>
>
> java.io.IOException: Pipeline: API v2.29 failed to load.
>  - You must update Jenkins from v2.107.1 to v2.121 or later to run this 
> plugin.
>   at 
> hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:655)
>   at hudson.PluginManager.dynamicLoad(PluginManager.java:876)
> Caused: java.io.IOException: Failed to install workflow-api plugin
>   at hudson.PluginManager.dynamicLoad(PluginManager.java:886)
>   at hudson.PluginManager.dynamicLoad(PluginManager.java:822)
>   at 
> hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1889)
> Caused: java.io.IOException: Failed to dynamically deploy this plugin
>   at 
> hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1893)
>   at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1651)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:522)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:277)
>   at 
> hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:112)
>   at java.lang.Thread.run(Thread.java:811)
>
>
> --
>
> Regards,
> Poovaraj
>
>
> --
> 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/CAMu9-ZUH8T2st%2BFHvYHz6jN%3DW%
> 3DifRpVOwzcqhook8F_r%3DoNbxQ%40mail.gmail.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/CAGYJMA_-MUXn9CettCY2OqwV%2BMr4LVfjAZ9Sppx4vxGTKbrT5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins - java.io.IOException: Pipeline: API v2.29 failed to load. - Error Message

2018-08-28 Thread Poovaraj Thangamariappan
Hi Team,

I am getting below error message while installing Jenkins Plugins. Why is
it showing below error message ? Please help me.

Machine : Linux
Jenkins Version : 2.107.1


java.io.IOException: Pipeline: API v2.29 failed to load.
 - You must update Jenkins from v2.107.1 to v2.121 or later to run this plugin.
at 
hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:655)
at hudson.PluginManager.dynamicLoad(PluginManager.java:876)
Caused: java.io.IOException: Failed to install workflow-api plugin
at hudson.PluginManager.dynamicLoad(PluginManager.java:886)
at hudson.PluginManager.dynamicLoad(PluginManager.java:822)
at 
hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1889)
Caused: java.io.IOException: Failed to dynamically deploy this plugin
at 
hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1893)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1651)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:522)
at java.util.concurrent.FutureTask.run(FutureTask.java:277)
at 
hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:112)
at java.lang.Thread.run(Thread.java:811)


-- 

Regards,
Poovaraj

-- 
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/CAMu9-ZUH8T2st%2BFHvYHz6jN%3DW%3DifRpVOwzcqhook8F_r%3DoNbxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.