How can I stop a Pipeline after unit tests?

2017-03-28 Thread Michael Holley
I've been searching all day today and have yet to find something that looks like it applies. I'm sorry if this answer has been hashed before and I just asked the all mighty Google the wrong questions. Here is the workflow I'm trying to bring over from my freestyle projects as Pipelines (the new

Re: p4 unshelve fails in a pipeline job

2017-03-28 Thread Ravi Kondamuru
I found the following issue in Jenkins issue tracker that seems to be related to what i am seeing: https://issues.jenkins-ci.org/browse/JENKINS-34014 The workaround suggested helps. thanks, Ravi. On Saturday, March 25, 2017 at 5:34:40 PM UTC-7, Ravi Kondamuru wrote: > > Hi, > > I have a pi

Re: Declarative pipeline: access JenkinsLocationConfiguration.getAdminAddress()?

2017-03-28 Thread Baptiste Mathus
I don't think it is common indeed, or at least I don't remember anything about it. You could file an issue in the tracker about it, and possibly see to propose a PR, that shouldn't be too involved I guess. It's likely to be more a matter of choosing wisely where/if to make it available. 2017-03-24

Re: Declarative pipelines vs scripted

2017-03-28 Thread Baptiste Mathus
Well, yes, you can use Shared Libraries with Declarative. Example: https://jenkins.io/blog/2017/02/15/declarative-notifications/ 2017-03-22 3:56 GMT+01:00 Cuong Tran : > The declarative option is nice but you will lose the ability to extract > out reusable code via the shared library. For exampl

Re: is there a way to get all the enabled jobs on a jenkins CI System

2017-03-28 Thread Baptiste Mathus
You should google for "Jenkins groovy script console". That should be something like (untested) "Jenkins.instance.getItem(' yourjob').isEnabled()" And doing this for all of them would be along Jenkins.instance.getItems(Job.class).each { job -> println job.name + " => " + job.enabled } 2017-03

Re: Auto approve or dismiss input from pipeline script

2017-03-28 Thread Baptiste Mathus
You'll need a specific script to read that share (a shell/powershell I mean, avoid using Jenkins API in Pipelines) before and handle this, independently of Jenkins (though you could also consider writing a plugin, depending on your use case). Then if that script finds something, it'll be some simp

Re: SVN Plugin - case sensitivity on tags, branches and trunk

2017-03-28 Thread Baptiste Mathus
Hello, I think this is a bit more than opinionated than what you say. I agree SVN does not enforce that, and have been using SVN for years myself (well, I stopped now). But this convention is present all over the place, like in https://svn.apache.org/repos/asf/subversion/trunk/doc/user/svn-best-pra

Re: [Pipeline] Extract artifacts from a build step

2017-03-28 Thread Danny Rehelis
Seems like your pipeline executes another build which generates the file you'd like to move. If this is the case, you should use archiveArtifacts as stash/unstash can be used with a scope of a single job only. Try: step ([$class: 'CopyArtifact', projectName: , selector: [$class: 'TriggeredBuildSel

RE: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Gardell, Steven
I am not sure if it is by design or not, but my experience is that setting currentBuild.result is unreliable. For example I saw it ‘cause’ a subsequent crash in the xunit results parser. So what I have settled on is using the groovy post-build API to set this, and treating ‘currentBuild.result’

Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Tomas Pekarovic
Thanks, but this approach is not working. 1) junit 'res.xml' will always report unstable ( I just can't get it to report something else) 2) catch will not catch unstable build 3) I tried: . parallel( "test1": { node('master'){ bat 'exit 0' bat 'type ei_result.xml > res.xml' try {

Re: REST api to trigger a job in the build pipeline

2017-03-28 Thread Sony Koithara
Very much curious to know about this.. Was anybdy able to figure out how we can do this ? -Sony Koithara On Tuesday, February 2, 2016 at 5:12:32 PM UTC-8, Ramnath Ananth wrote: > > Yes, I am using the build pipeline plugin and am going through the source > code to see if I can change it to acc

Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread jerome
This seem like a declarative way bug too me. I do this into full scripts (changing the current build result) and it work fine. I haven't tested the declarative (post {}, always {}, ...), but you could try a Jenkinsfile without the declarative syntax: node() { try { // make you junit test that

Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Jérôme Godbout
Setting stable is not an available enum value, so you fall back to FAILURE I guess. If you set success, make sure you make it case sensitive currentBuild.result = 'SUCCESS' [image: bodycad] Jerome Godbout Software Developer 2035 rue du Haut-Bord, Québec, QC, Canada. G1

Build Monitor Plugin

2017-03-28 Thread Joaquin Henriquez
Hi This plugin: https://github.com/jan-molak/jenkins-build-monitor-plugin Post Groovy build: def result = manager.build.testResultAction.result def total = result.totalCount def failed = result.failCount manager.addShortText(failed + " / " + total + " failed") Exception (class: http://javadoc

Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Tomas Pekarovic
Question is why when i set 'success' nothing happen. If I set 'stab'e, it will recolor all the pipeline steps to GREEN and after that result of build is 'FAILURE' On Tue, Mar 28, 2017 at 6:52 PM, wrote: > Take care the currentBuild.result will be unset if successful up to that > point. There's

Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread jerome
Take care the currentBuild.result will be unset if successful up to that point. There's no 'STABLE' 'SUCCESS' 'UNSTABLE' 'FAILURE' 'ABORTED' 'NOT_BUILT' http://javadoc.jenkins-ci.org/hudson/model/Result.html -- You received this message because you are subscribed to the Google Groups "Jenkins

Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Tomas Pekarovic
hmm.. great thanks On Tue, Mar 28, 2017 at 6:09 PM, Daniel Beck wrote: > > > On 28.03.2017, at 15:18, Tomas Pekarovic wrote: > > > > it seems to me as a bug. > > Works as intended and documented: > http://javadoc.jenkins.io/hudson/model/Run.html#setResult%28hudson.model. > Result%29 > > --

Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Daniel Beck
> On 28.03.2017, at 15:18, Tomas Pekarovic wrote: > > it seems to me as a bug. Works as intended and documented: http://javadoc.jenkins.io/hudson/model/Run.html#setResult%28hudson.model.Result%29 -- You received this message because you are subscribed to the Google Groups "Jenkins Users" gro

Pipeline: limit concurrency of parallel jobs with lock or in other way

2017-03-28 Thread kodstark
Hi, I'm not able to find how to limit concurrency of parallel step. I know that one option is to use jenkins node label but it is too heavy. It thought that by design parallel should work with lock but locks allows to give quantity only with label - so I tried this: for (int idx = 0; idx

[Pipeline] Extract artifacts from a build step

2017-03-28 Thread David Campos
Hi, I'm trying to migrate some of our jobs to Jenkins 2.0 Pipeline and I'm facing issues copying data around. Our jobs are generated by a DSL and there are a big bunch of jobs created. I use 'build' steps to run those jobs and try to copy data from them to use them in the following steps... B

Re: Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Richard Ginga
Tomas, I don't think you can set a job's resultant status Better than it currently is. You can set it down. e.g. unstable->failure On Tue, Mar 28, 2017 at 9:18 AM, Tomas Pekarovic wrote: > HI, > > I have this post-buidl action: > > post { > always { > script { >

building dependent projects in a declarative pipeline.

2017-03-28 Thread William McKenzie
I'm using the bitbucket branch source plugin. How do you control the overall build order? If I have, say, 12 repos in my bitbucket project, and they need to be built in a certain dependency order, how to I specify this declaratively in the Jenkinsfile of each repo? Or is that even possible? thanks

Scripted pipeline with reentrant lock vs deadlock

2017-03-28 Thread kodstark
Hi, I've looked if anybody discussed reentrant lock with jenkins pipeline but couldn't find anything at this group. Consider this scenario when I want to have pipelines ALL, DEPLOY, TESTS. Last two pipelines have around 20 lines and I don't want to repeat that in ALL so ALL would just call tho

Build always ends with FAILURE after setting currentBuild.result = 'STABLE' / 'SUCCESS'

2017-03-28 Thread Tomas Pekarovic
HI, I have this post-buidl action: post { always { script { if (currentBuild.result == 'UNSTABLE'){ currentBuild.result = 'STABLE' } currentBuild.result = 'SUCCESS' } } } All i n

Jenkins and VM

2017-03-28 Thread Joaquin Henriquez
Hi List, I have Jenkins master running on a Linux server. I need to test certain SW (MSI) installation on many Windows versions. I have seen that VirtualBox only supports up to 4.3 (I am running on 5.1). Is there any other way to spinup before test and powerdown after test with a VM? BR Joaqu

Day Of Jenkins Oslo & Gothenburg

2017-03-28 Thread Adam Henriques
Dear fellow Jenkins enthusiasts! We are planning a "*Day of Jenkins*" in Gothenburg on May 30th , and in Oslo on June 1st . *Jenkins Festival* Day of Jenkins is a full day of hands-on workshops and demos of the Jenkins

Re: warnings plugin groovy script

2017-03-28 Thread Alex
It works like that. Thank you very much :) On Thursday, 23 March 2017 16:06:22 UTC, Ewelina Wilkosz wrote: > > I think you may need to use descriptor > > def warningDesc = > Jenkins.getInstance().getDescriptor(hudson.plugins.warnings.WarningsPublisher) > > and then add the parser with it: > > wa

Pipeline: Groovy closure returns early after method call

2017-03-28 Thread Mark J. Becker
Hi, I have a problem executing closures in my pipeline, since they return early. I could break down the problem to the following minimal example: class Foo { Closure cl = { String a -> return "Say: ${this.bar(a)}" } String bar(String a) { return "Hello ${a}." } }

Pipeline: Remote call on node failed

2017-03-28 Thread Sverre Moe
I have been getting an IOException I cannot understand why it happens or if my builds are invalid because of it. Cannot contact r12-sles12.1-x86_64: java.io.IOException: Remote call on r12-sles12.1-x86_64 failed The build does seem to go fine with this error. On some operations there are seve