Re: Pipeline: Is SCM revision information stored with each build?

2017-08-16 Thread Dallas Clement
Answering my own question again. It looks like there is some API available for getting SCM revision info in a groovy sandbox environment. def getChanges() { def lines = [] def changeSets = currentBuild.changeSets for (int i = 0; i < changeSets.size(); i++) { def entries =

Re: java.io.IOException: Unable to read /var/lib/jenkins/jobs/MyJobTest/config.xml

2017-08-16 Thread Thad Guidry
Yes we do. Versions are the latest on new Jenkins and latest or near latest (1 version back) on the old Jenkins. Unfortunately, the logs are not clear on if a particular plugin was causing an issue... it treats the whole flow-definition as an exception. I would expect much better handling of

Re: java.io.IOException: Unable to read /var/lib/jenkins/jobs/MyJobTest/config.xml

2017-08-16 Thread Slide
Do you have all the same plugins (and plugin versions) installed on the second instance of Jenkins? On Wed, Aug 16, 2017 at 12:44 PM Thad Guidry wrote: > We recently backed up our /jobs folder on Jenkins 2.73 and copied this to > another Jenkins.2.73 server running on RHEL

java.io.IOException: Unable to read /var/lib/jenkins/jobs/MyJobTest/config.xml

2017-08-16 Thread Thad Guidry
We recently backed up our /jobs folder on Jenkins 2.73 and copied this to another Jenkins.2.73 server running on RHEL 7.1 We get the following stacktrace on many of them trying to read the config.xml and not all the jobs are being loaded onto the Job dashboard... Aug 16, 2017 2:01:32 PM

Re: jenkins pipeline post actions not working

2017-08-16 Thread red 888
So if I look at it from old jenkins view I can actually see it under the "Stage View" as "Declarative: Post Actions". But how do I view the Declarative: Post Actions in Blue Ocean? On Wednesday, August 16, 2017 at 1:54:27 PM UTC-4, red 888 wrote: > > I setup a post action like in the examples:

jenkins pipeline post actions not working

2017-08-16 Thread red 888
I setup a post action like in the examples: pipeline { agent any stages { stage('Example1') { steps { bat 'return 1' } stage('Example2') { steps { echo 'Wont see this' }

Pipeline: Is SCM revision information stored with each build?

2017-08-16 Thread Dallas Clement
I know that I can get the latest revision for the current build by executing a shell command such as: def currentCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim() But I would like to get the commit hash associated with a previous build. The reason I want to do this is

What is the difference between step vs steps in jenkinsfile?

2017-08-16 Thread red 888
I'm trying to run xunit and I keep seeing examples with only "step" like this: step([$class : 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1, thresholds: [ [$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '',

Re: Is is possible to define methods in a declarative pipeline?

2017-08-16 Thread Dallas Clement
I'm answering my own question here. It looks like this is indeed possible. I added some method definitions at the end of my Jenkinsfile following the pipeline definition. I was able to call the methods from a script {} embedded in stages and post sections. On Wednesday, August 16, 2017 at

Re: Using Secrets as "environment variables" in containerTemplate of jenkins-kubernetes-plugin

2017-08-16 Thread YAN-HONG WANG
@Carlos, thanks very much. Am Mittwoch, 16. August 2017 16:59:53 UTC+2 schrieb Carlos Sanchez: > > will be in 0.13 > > On Wed, Aug 16, 2017 at 2:54 PM, YAN-HONG WANG > wrote: > >> Hello Carlos: >> >> Is method "*secretEnvVar*" already in *Kubernetes plugin 0.12*? Or that

Re: Declarative pipeline with loop and input timeout

2017-08-16 Thread Guy Knights
Thanks Victor, I'll take a look at it when I get a chance and see if I can use your solution. Cheers, Guy On Tue, Aug 15, 2017 at 1:49 PM, Victor Martinez < victormartinezru...@gmail.com> wrote: > I did a kind of similar but not equally implementation. The important bit > is to try/catch and

Is is possible to define methods in a declarative pipeline?

2017-08-16 Thread Dallas Clement
I would like to be able to define some groovy methods in my declarative Jenkinsfile and call as needed from a script {} section. For example I would like to define some methods that extract git commit information from the jenkins API and use when notifying concerning build status from one of

Re: Getting the real Jenkins job status for a pipeline job.

2017-08-16 Thread Dallas Clement
Thanks for these helpful ideas. Seems like this would work fine. One last related question: How dost one trigger the 'unstable' condition in the pipeline post section? On Wednesday, August 16, 2017 at 11:09:12 AM UTC-5, slide wrote: > > You could do this with a map > > Map stageResults =

Re: Getting the real Jenkins job status for a pipeline job.

2017-08-16 Thread Slide
You could do this with a map Map stageResults = [:] stage('Foo') { stageResults['Foo'] = Result.FAILURE } stage('Bar') { stageResults['Bar'] = Result.SUCCESS } Not ideal, but should work. On Wed, Aug 16, 2017 at 8:57 AM Victor Martinez < victormartinezru...@gmail.com> wrote: >

Re: Getting the real Jenkins job status for a pipeline job.

2017-08-16 Thread Victor Martinez
Unfortunately, I'm also asking a kind of similar question: - https://groups.google.com/forum/#!topic/jenkinsci-users/9UYN8FZL35k I haven't worked out how to do it without creating variables specifically per stage -- You received this message because you are subscribed to the Google Groups

Re: Getting the real Jenkins job status for a pipeline job.

2017-08-16 Thread Dallas Clement
Victor, you are sure right. This works like a champ! Thank you very much. Do you know if it's possible to get the status for each stage in a pipeline? On Wednesday, August 16, 2017 at 10:13:46 AM UTC-5, Victor Martinez wrote: > > As far as I see "currentBuild.getCurrentResult()" is not null

Re: Getting the real Jenkins job status for a pipeline job.

2017-08-16 Thread Victor Martinez
As far as I see "currentBuild.getCurrentResult()" is not null even though when no set was explicitly set, this is my snippet and console output pipeline { agent any stages { stage ('release') { steps { script { echo "echo

Re: Declarative pipeline: "Data generation failure: null" in input step

2017-08-16 Thread Sascha Schwarz
On Wednesday, 16 August 2017 12:36:05 UTC+2, Victor Martinez wrote: > > Hey, > > It seems you are missing the displayVersion and valueExpression attributes. > Thank you! :) It seems that the displayVersion Parameter must not be null. :/ Thanks again Sascha -- You received this message because

Re: Image name and version of containerTemplate by variable created during execution of pipeline?

2017-08-16 Thread Carlos Sanchez
On Wed, Aug 16, 2017 at 1:55 PM, YAN-HONG WANG wrote: > Hello Carlos, > > Now in my Jenkinsfile.groovy I create a *slave container* in *other pod*. > I use "*load*" this function to implement. > > But, I found out that *pod *will be *destroyed automatically* when that

Re: Using Secrets as "environment variables" in containerTemplate of jenkins-kubernetes-plugin

2017-08-16 Thread Carlos Sanchez
will be in 0.13 On Wed, Aug 16, 2017 at 2:54 PM, YAN-HONG WANG wrote: > Hello Carlos: > > Is method "*secretEnvVar*" already in *Kubernetes plugin 0.12*? Or that > will be released in nearly future *0.13*? > > Because I got the error message like this ... > >

Re: Getting the real Jenkins job status for a pipeline job.

2017-08-16 Thread Dallas Clement
Victor, thanks for the help here. I have played with the 'changed' action and also currentBuild.result and currentBuild?.getPreviousBuild(), but it looks like this variable is null unless explicitly set in one of the pipeline stages. What I really want is the status Jenkins uses to determine

Re: How to restrict access to some shared libraries methods

2017-08-16 Thread R. Tyler Croy
(replies inline) On Wed, 16 Aug 2017, Cristiano Kliemann wrote: > Hi, > > We are developing pipeline shared libraries to organize common tasks. Some > of the functionality involves deploying files to our binary repository. > We've decided to create small classes and methods to keep things

How to restrict access to some shared libraries methods

2017-08-16 Thread Cristiano Kliemann
Hi, We are developing pipeline shared libraries to organize common tasks. Some of the functionality involves deploying files to our binary repository. We've decided to create small classes and methods to keep things simple and maintainable. But we have some concerns about what the developer

Jenkins Pipeline is not getting displayed Properly in BlueOcean

2017-08-16 Thread SS
Hi Devs, This is my first post to this forum . We had a requirement to create a pipeline having the below flow. For the above flow written the code

Re: Using Secrets as "environment variables" in containerTemplate of jenkins-kubernetes-plugin

2017-08-16 Thread YAN-HONG WANG
Hello Carlos: Is method "*secretEnvVar*" already in *Kubernetes plugin 0.12*? Or that will be released in nearly future *0.13*? Because I got the error message like this ... *java.lang.NoSuchMethodError: No such DSL method 'secretEnvVar' found among steps * Thanks very much. Best regards,

RE: Does anyone know if the MSTest plugin supports pipelines and howto use it in a pipeline (jenkinsfile)?

2017-08-16 Thread Daniel Butler
The XUnit plugin has support for MSTest output and is pipeline compatible. You’d still need to run MSTest from a bat/powershell command but the Xunit plugin will publish the test output. From: jer...@bodycad.com Sent: 16 August 2017 13:24 To: Jenkins Users Subject: Re: Does anyone know if the

Re: Does anyone know if the MSTest plugin supports pipelines and how to use it in a pipeline (jenkinsfile)?

2017-08-16 Thread jerome
Sadly no, many puglin are still incompatible, you can see the compatibility list here: https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md Since the .trx is just an xml file, you could try to do an .xslt file that do the convertion to junit .xml. Maybe someone already did

Re: Image name and version of containerTemplate by variable created during execution of pipeline?

2017-08-16 Thread YAN-HONG WANG
Hello Carlos, Now in my Jenkinsfile.groovy I create a *slave container* in *other pod*. I use "*load*" this function to implement. But, I found out that *pod *will be *destroyed automatically* when that *slave container* was executed. That slave container is a PostgreSQL daemon. That needs to

ERROR: Could not send email as a part of the post-build publishers.

2017-08-16 Thread NIGHIL VADAKKAN
Please help me to resolve this. I am not able to sent failure email notification as a part of post build action Email was triggered for: Failure Sending email for trigger: Failure Sending email to: nighi...@microsemi.com ERROR: Could not send email as a part of the post-build

Re: Declarative pipeline: "Data generation failure: null" in input step

2017-08-16 Thread Victor Martinez
Hey, It seems you are missing the displayVersion and valueExpression attributes. The below snippet works, ... input id: 'userInput', message: 'Text goes here', parameters: [[ $class: 'DropdownAutocompleteParameterDefinition', name: 'MyName', dataProvider:

Re: Getting the real Jenkins job status for a pipeline job.

2017-08-16 Thread Victor Martinez
Hey Dallas, Cannot you just use the changed condition https://jenkins.io/doc/book/pipeline/syntax/#post? Then you can use the http://javadoc.jenkins.io/plugin/workflow-support/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.html#resultIsBetterOrEqualTo-java.lang.String- See the

Declarative pipeline: "Data generation failure: null" in input step

2017-08-16 Thread Sascha Schwarz
Hi! The following Code just produces an empty dropdown list and an error message: Data generation failure: null pipeline { options { buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3')) } agent none stages { stage('input') { steps

Re: Release Button or best practice

2017-08-16 Thread Steven Foster
On Tuesday, August 15, 2017 at 6:09:04 PM UTC+1, Simon Richter wrote: > > > You are looking for the "Promoted Builds" plugin. > > Ah, I did come across this but unfortunately we are using pipeline builds and it seems this isn't compatible -- You received this message because you are

Getting the real Jenkins job status for a pipeline job.

2017-08-16 Thread Dallas Clement
I have setup a declarative Jenkinsfile for my project. I have some post conditions defined for success and failure. I would like to be able to determine the job status for the previous build within the 'success' block so that I can know if this success is a recovery from a previous failure.