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 Pipeline project is set up as a Multi-branch project 
with a Jenkinsfile).

1. A dev branches off of master and starts work on a feature. Whenever he 
pushes new code to GitHub I want Jenkins to set up the workspace, build the 
code, run tests, and then stop.
2. Once he get's his code to build clean he creates a PR.
3. Jenkins sees the PR and builds that, but once again, should stop after 
tests pass.
4. The success status, after tests, is pushed back to GitHub which then 
enables the PR to be merged with the master branch.
5. Now that the master branch has been updated, Jenkins once again sets up 
the workspace, builds the code, runs test, but now deploys to staging, 
waits for approval, then pushes to prod.

Another way to ask the question, how do I put logic into a Pipeline to only 
run certain stages depending on what branch/PR is being built?

As of right now, I have a single Jenkins file with the checkout, build, 
test, and deploy stages in it, and every time a branch is updated, a PR 
created, and with a merge to master, the code is able to be deployed. I 
don't want the code to be able to be deployed until after it's merged to 
master. Any thoughts on how to make this happen? 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/2615c315-9686-4f70-975c-364f065000f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 pipeline based job where I do an unshelve, if user provides it as 
> input. However, I see that it always indicates "no such files". If i run 
> the command on a regular system it succeeds. I am not able to figure out 
> what this error indicates. 
>
> Any help will be appreciated.
>
> thanks,
> Ravi.
>
>
>
> Console log:
>
> [vpx] P4 Task: unshelve review: 582305
> [vpx] (p4):cmd:... p4 unshelve -f -s582305 -cdefault
> [vpx] p4 unshelve -f -s582305 -cdefault
> [vpx] 
> [vpx]  - no such file(s).
> [vpx] 
> [vpx] (p4):stop:6
> [vpx] ... duration: (7ms)
>
>
>
> Jenkinsfile:
>
>
> checkout([$class: 'PerforceScm', 
> credential:'42c7583c-d502-41d9-abac-d9ab9a9ea574', ...)
>
> if (Shelved_Changelist_No != "") {
>
> p4unshelve resolve: 'am', shelf:"${Shelved_Changelist_No}", 
> credential:'42c7583c-d502-41d9-abac-d9ab9a9ea574'
>
> }
>
>

-- 
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/9cce2806-c5c5-4e96-98d9-bfe7f260adb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 0:37 GMT+01:00 Jon Dufresne :

> Hi,
>
> Thanks for the response. I gave this a shot. It results in the following 
> error:
>
> groovy.lang.MissingPropertyException: No such property: hudson for class: 
> groovy.lang.Binding
>
> But I think the fix is to change hudson to jenkins. So I tried this and get 
> the following results:
>
> org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts 
> not permitted to use staticMethod jenkins.model.JenkinsLocationConfiguration 
> get
>
> So I think they is still something missing. Not sure how best to proceed. Is 
> it not so common to access the default admin email address in a Jenkinsfiles?
>
>
> On Tue, Mar 21, 2017 at 7:42 PM, Cuong Tran  wrote:
>
>> You can access it via:
>>
>> hudson.model.JenkinsLocationConfiguration.get().getAdminAddress()
>>
>>
>> You could also define a global variable on Jenkins and access it as
>> "env.JENKINS_EMAIL".
>>
>> To take it a step further, you can encapsulate the whole thing in a
>> library using Global Shared Library plugin:
>>
>>   https://jenkins.io/doc/book/pipeline/shared-libraries
>>
>> On Monday, March 20, 2017 at 2:28:12 PM UTC-7, Jon Dufresne wrote:
>>>
>>> Hi,
>>>
>>> I have several multibranch pipeline jobs that all use a declarative
>>> pipeline. The Jenkinsfiles contain the following snippet:
>>>
>>> post {
>>> failure {
>>>   step([$class: 'Mailer', recipients: 'c...@example.com',
>>> sendToIndividuals: true])
>>> }
>>>   }
>>>
>>> I would like to avoid hard coding the address "c...@example.com" in all
>>> Jenkinsfiles. It is repetitive and is also incorrect when testing on a
>>> staging server or in a VM.
>>>
>>> It occurred to me that one option could be to send to the address
>>> "JenkinsLocationConfiguration.getAdminAddress()" [0], as this is
>>> configured correctly in all scenarios listed above.
>>>
>>> Is there an easy way to access this value from a Jenkinsfile? Is it
>>> available as some local or environment variable? A normal groovy import and
>>> method call didn't work and instead raised an exception.
>>>
>>> If there is a better way to configure this globally, I'd consider that
>>> as well.
>>>
>>> Cheers,
>>> Jon
>>>
>>> [0] http://javadoc.jenkins.io/jenkins/model/JenkinsLocationConfi
>>> guration.html#getAdminAddress()
>>>
>> --
>> 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/2014b1d4-e910-4f06-b26f-8bbb5a56b92e%
>> 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/CADhq2b7yL7Q%2BiJ01n3Bkk-
> HGXRwJGDPRsXYkBZ13PxwM1TN1rQ%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/CANWgJS7mpjj2YUY0mTK8LVgUEvegdh1CcCJ-vaVLs436hndavA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 example, you can't do this
> yet:
>
> MyCompanyStandardPipeline {
> ... // which will plugin standard sections...
> }
>
> On Thursday, March 16, 2017 at 8:55:48 PM UTC-7, Nick Le Mouton wrote:
>>
>> Hi,
>>
>> I'm just getting my head around pipeline as code and have converted my
>> previous Jenkins job/ant build targets to a Jenkinsfile. As I was looking
>> for documentation on the Jenkins site, I'm seeing mentions of declarative
>> pipelines and it differs from what I've written.
>>
>> Which method should I be looking to use (especially with blue ocean)?
>> Declarative or scripted? Why should I be using one over the other?
>>
>> Can I also get some feedback on my Jenkinsfile (
>> https://gist.github.com/NoodlesNZ/bf9b50cab82093097796d354e37083f0)?
>> It's hard to find examples beyond "hello world"/simple pipelines.
>>
>> 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/fdd17e1a-35fa-41b2-bd16-e5c136a456f8%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/CANWgJS64LZKR%3Dy8LuVMYJfBRewCZPfRbpyg7PwSd3Af3TaFBpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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-21 20:39 GMT+01:00 Raj :

> I would like to know if there is a way to use jenkins cli jar file and
> find out if a given job is enabled or currently disabled.
> i have about 700 jobs on the server and would like to know the list of
> enabled and disabled jobs
>
> Thank you very much for your time.
> regards,
> Raj
>
> --
> 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/1f3e4cf9-64ab-48cb-8c36-7039b0ae99b4%
> 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/CANWgJS4vSn5sTCx6Z8ypND8%3DzO2MajcL6TMGHnLtYav0iGQPeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 simple if().



2017-03-21 19:36 GMT+01:00 Raja Chinnam :

> Hello
>
> I have a file input that pauses the build. The user may manually upload
> the file using the file input or make the file available on a network
> share. I am using the parallel construct to fork two branches - one for the
> input and one to look for the file on the share. Is there a way I can
> dismiss or approve the input if a file is found on the share?
>
> I have tried a couple of ways but haven't had any luck so far.
>
> I tried to approve/remove this input:
> input id: '1005', message: 'hello world', ok: 'ok', parameters: [
> string(defaultValue: 'ans', description: '', name: 'test')]
>
>
>
> My first option:
> def INPUT_URL = "${currentBuild.getAbsoluteUrl()}input/1005/submit"
>
> def queryString = "name=test=ans=ok"
>
> def conn = INPUT_URL.toURL().openConnection()
>
> conn.setRequestMethod("POST")
> conn.doOutput = true
> def writer = new OutputStreamWriter(conn.outputStream)
> writer.write(queryString)
> writer.flush()
> writer.close()
> conn.connect()
>
>
>
> This gives me a 403 forbidden.
>
>
>
> My second option:
> @NonCPS
>
> def enumActions(){
> def actionsList = currentBuild.rawBuild.getAllActions()
> Action npt = null
>
> for(Action acn : actionsList){
> if(acn.getUrlName() == 'input') npt = acn
>
> }
> currentBuild.rawBuild.removeAction(npt)
>
>
> //def npta = (org.jenkinsci.plugins.workflow.support.steps.input.
> InputAction)npt
>//Is there a way to call approve methods on the above.
> }
>
>
>
> I have tried several things with this code and they mostly fail with
> NonSerializable exception.
>
> Thank you
> Raja
>
> --
> 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/adf671a8-7f92-496a-8557-978c1062805a%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/CANWgJS6_0aqaLLnnCC%2Bgq%2Bi%2BV1nd1ju-RktHQQ%2Bz-YAjUbkLSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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-practices.html

So, I'm not surprised the plugin does not parse this as the same.

Now, having said that. I guess proposing a PR on the plugin to use a system
prop, or even a global checkbox to allow case insensitivity could be
considered. But in the end, it will also the maintainer's choice to support
or not an additional complexity for a possibly pretty rare situation.

You probably want to search or file an issue describing your case first,
and propose an associated pull-request to move forward.

Cheers

2017-03-20 15:19 GMT+01:00 Kenneth Guardanapo :

> Our projects have been built with the folders under the project named
> Tags, Trunk and Branches.  When I create a parameterized project and try to
> build using it, it only shows those names in the dropdown.  I am unable to
> see anything under the folders.
>
> If I rename them to tags, trunk and branches, the drop-down will show only
> the folders that have projects commited under them and the plugin works as
> advertised.
>
> I do not see where there are any requirements for naming conventions to
> use the plugin.  SVN allows you to name them as you see fit, so the plugin
> should be able to work with whatever names are in the folder in any case.
> Is this a matter of a minor change in the plugin code to remove this
> restriction?
>
> --
> 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/4ae3c88a-57c7-48a6-88e7-4c6d066deebb%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/CANWgJS49EENPqkAu%2BVeyBXj%3D8vUATu_w_n6ZRBm_s2CLqv-5NQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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: 'TriggeredBuildSelector']]);

On Tue, Mar 28, 2017 at 6:53 PM, David Campos  wrote:

> 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... But I'm unable to copy anything...
>
> Example:
>
> node('master') {
> stage("Produce data") {
> build('test.producer')
> }
>
> stage("Collect data") {
> unarchive(mapping: ['file.txt': 'file.txt'])
> readProperties('file.txt')
> echo "Variable value: ${DATA}"
> }
> }
>
>
> I tried everything... stash and unstash, unarchive, etc... What I'm doing
> wrong?
>
> The 'test.producer' job creates a file that is expected to be copied at
> the Collect stage.
>
> This is the output:
>
> [Pipeline] nodeRunning on master in 
> /var/jenkins_home/jobs/test.pipeline/workspace[Pipeline] {[Pipeline] 
> stage[Pipeline] { (Produce data)[Pipeline] build (Building 
> test.producer)Scheduling project: test.producer 
> 
>
> Starting building: test.producer #7 
> [Pipeline] }[Pipeline] // 
> stage[Pipeline] stage[Pipeline] { (Collect data)[Pipeline] 
> unarchive[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // 
> node[Pipeline] End of PipelineERROR: no artifacts to unarchive in 
> file.txtFinished : 
> FAILURE
>
>
> with stash
>
> Started by user anonymous [Pipeline] 
> nodeRunning on master in 
> /var/jenkins_home/jobs/test.pipeline/workspace[Pipeline] {[Pipeline] 
> stage[Pipeline] { (Produce data)[Pipeline] build (Building 
> test.producer)Scheduling project: test.producer 
> 
> Starting building: test.producer #4 
> [Pipeline] stash[Pipeline] 
> }[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] End of 
> PipelineERROR: No files included in stashFinished 
> : FAILURE
>
>
> Thanks for the help you can provide me
>
> --
> 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/f95ef25a-c8d7-4e3d-9eb9-27b4280f12d1%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/CAObRFCWZFSCsSoVGKZozs_02Skbk30QzDZ-e0_5FRvwXCP135Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 {
   junit 'res.xml'
   if (currentBuild.result == 'UNSTABLE'){
currentBuild.result = 'SUCCESS'
}
} catch(err) {
throw(err)
}
}
},
"test2": {
  node('robot'){
echo "dfds"
}  ...

It's always ending up Yellow, as unstable


On Tue, Mar 28, 2017 at 7:59 PM,  wrote:

> 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 make unstable here
> }catch()
> {
> if (currentBuild.result == 'UNSTABLE')
> currentBuild.result = 'SUCCESS'
> }
> }
>
> This should work, if so, it mean that the declarative syntax have a bug in
> it and the currentBuild.result is somehow a copy used into the post scope
> and restore after the processing of the declarative post {}. You should
> open a bug report if so.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/r35UO_Ji4c8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/c18bc05d-ba2e-44e5-8a0f-ffd2dd42e306%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/CAKokUHBRdQ1LFPgc7WzPPojzz4hpFnMzjPX_%2BqW3Q%3DEu8jAbTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 accommodate my requirement.
>
> On Tue, Feb 2, 2016 at 4:58 PM, Michael Neale  > wrote:
>
>> Are you using this plugin? 
>> https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin
>>
>> There are a few that do that type of thing, not sure how involved that 
>> type of change would be.
>>
>> On Wed, Feb 3, 2016 at 11:28 AM Ramnath Ananth > > wrote:
>>
>>> Is there a way to tweak the build api source code so that it can sync 
>>> with the UI pipeline and show its results ?
>>>
>>> Any help in this will be great .
>>>
>>> Thanks
>>> Ramnath
>>>
>>>
>>> On Monday, February 1, 2016 at 6:04:18 AM UTC-8, Ramnath Ananth wrote:

 Yes , thats correct. 
 On Jan 31, 2016 11:26 PM, "Michael Neale"  wrote:

> Well you certainly can call jobB, but I think you want it to show up 
> in the plugin visualisation. 
>
> On Mon, Feb 1, 2016 at 5:31 PM Ramnath Ananth  > wrote:
>
>> Yes, for example imagine job A to be build job for a project and job 
>> B is a job to deploy the artifacts archived from job A to a DEV or a UAT 
>> environment.
>>
>> Basically I want to deploy artifacts to an environment using job B 
>> through the REST api, in which I am not successful so far. Maybe this is 
>> not possible currently through REST.
>>
>> Will have to explore more.
>>
>>
>>
>> On Sunday, January 31, 2016 at 10:21:07 PM UTC-8, Michael Neale wrote:
>>>
>>> OK I think I understand. So you can trigger jobA (and things work as 
>>> expected) but sometimes you want to trigger jobB without jobA, but you 
>>> still want it to show up in the pipeline view you have? 
>>>
>>> I don't think there is a way to do that at the moment, as the 
>>> pipeline viewer plugins only look at the starting job I believe 
>>> (starting 
>>> at B would almost look like a different pipeline). 
>>>
>>> I wonder if one way is to trigger jobA, but with an optional 
>>> parameter that makes its steps a no-op, so it just flows on to jobB 
>>> (that 
>>> is the best I can think of). 
>>>
>>> On Monday, February 1, 2016 at 2:23:49 PM UTC+11, Ramnath Ananth 
>>> wrote:

 Hi Michael

 This is a freestyle job and yes, I am triggering the job to run.

 I tried your solution to add post build action to trigger job B 
 after job A is triggered through the api and it works.

 But my use case is to trigger job B not immediately but at any 
 given time.

 So as of now whenever I trigger job B using /job/JobB/build api job 
 B successfully runs , but I can't see it on the UI pipeline view of 
 jenkins 
 , the way you see it in the pipeline view when you trigger from the UI
 On Jan 31, 2016 7:10 PM, "Michael Neale"  
 wrote:

> Ramnath, some questions: 
>
> 1) what type of job - freestyle, workflow/pipeline or something 
> else? 
> 2) when you say "trigger a deploy job remotely" - do you mean 
> create the job? or just trigger it to run ? 
>
> Normally what people do is check "Build after other projects are 
> built" on JobB config (in the "Build Triggers" section) - and put 
> JobA in 
> there. Then, any time JobA completes, JobB will run. 
>
> Alternatively, in JobA you could put a post build action to 
> trigger JobB. 
>
> Then, from an api, you only ever need to trigger JobA and JobB 
> will follow. 
>
> Otherwise, I don't know what you mean by "linked to the pipeline 
> or not". 
>
>
>
>
>
> On Saturday, January 30, 2016 at 10:50:06 AM UTC+11, Ramnath 
> Ananth wrote:
>>
>> My question is the same as this discussion
>>
>>
>> https://groups.google.com/d/topic/jenkinsci-users/wbggN5aBHgU/discussion
>>
>> Hope this helps
>>
>> Thanks
>> Ramnath
>> On Friday, January 29, 2016 at 2:27:53 PM UTC-8, Ramnath Ananth 
>> wrote:
>>>
>>> Hi Jason.
>>>
>>> I have used the mentioned build with parameters option and it 
>>> works through REST api. But the build result is not getting 
>>> reflected in 
>>> the Build pipeline view. It is still in its original pipeline color 
>>> and the 
>>> 

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 make unstable here
}catch()
{
if (currentBuild.result == 'UNSTABLE')
currentBuild.result = 'SUCCESS'
}
}

This should work, if so, it mean that the declarative syntax have a bug in 
it and the currentBuild.result is somehow a copy used into the post scope 
and restore after the processing of the declarative post {}. You should 
open a bug report if so.

-- 
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/c18bc05d-ba2e-44e5-8a0f-ffd2dd42e306%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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. G1N 4R7
T:  +1 418 527-1388
E: jer...@bodycad.com
www.bodycad.com

The contents of this email message and any attachments are intended solely
for the addressee(s) and may contain confidential and/or privileged
information and may be legally protected from disclosure. If you are not
the intended recipient of this message or their agent, or if this message
has been addressed to you in error, please immediately alert the sender by
reply email and then delete this message and any attachments. If you are
not the intended recipient, you are hereby notified that any use,
dissemination, copying, or storage of this message or its attachments is
strictly prohibited.

Le contenu de ce message et les pièces jointes sont destinés uniquement
pour le(s) destinataire(s) et peuvent contenir des informations
confidentielles et / ou privilégiées qui peuvent être protégées légalement
contre toute divulgation. Si vous n'êtes pas le destinataire de ce message
ou son agent, ou si ce message vous a été adressé par erreur, s’il vous
plaît avertir immédiatement l'expéditeur par courriel de réponse, puis
supprimer ce message et les pièces jointes. Si vous n'êtes pas le
destinataire prévu, vous êtes par la présente informé que toute
utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces
jointes est strictement interdit.

On Tue, Mar 28, 2017 at 1:05 PM, Tomas Pekarovic 
wrote:

> 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 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 a topic in the
>> Google Groups "Jenkins Users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/jenkinsci-users/r35UO_Ji4c8/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/81762c79-b462-4839-b7b3-13eea7ef884c%
>> 40googlegroups.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/r35UO_Ji4c8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAKokUHCu0WEcTjCBKqg3-2Nd6%
> 3DRr1DkfeBQhaqkon5Gt-Rv2dw%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/CAKmu%2Be09e%3DuN9p%3DLg7sPR6efW%2B9gy%2B%3D%2By75KmVAgOcUdbWRF5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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.jenkins-ci.org/junit/hudson/tasks/junit/TestResultAction.html):
18:20:58 ERROR: Failed to evaluate groovy script.
18:20:58 java.lang.NullPointerException: Cannot get property 'result' on null 
object
18:20:58   at 
org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
18:20:58   at 
org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172)
18:20:58   at 
org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47)
18:20:58   at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
18:20:58   at Script1.run(Script1.groovy:1)
18:20:58   at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585)
18:20:58   at groovy.lang.GroovyShell.evaluate(GroovyShell.java:623)
18:20:58   at groovy.lang.GroovyShell.evaluate(GroovyShell.java:594)
18:20:58   at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:170)
18:20:58   at 
org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:362)
18:20:58   at 
hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
18:20:58   at 
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
18:20:58   at 
hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
18:20:58   at 
hudson.model.Build$BuildExecution.post2(Build.java:185)
18:20:58   at 
hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
18:20:58   at hudson.model.Run.execute(Run.java:1753)
18:20:58   at 
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
18:20:58   at 
hudson.model.ResourceController.execute(ResourceController.java:98)
18:20:58   at hudson.model.Executor.run(Executor.java:404)

Thanks

Jo

-- 
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/1728ba9310c8482885831a4815a592fe%40BSKEXCH2013HYPV.mwrinfosecurity.com.
For more options, visit https://groups.google.com/d/optout.


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 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 a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/r35UO_Ji4c8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/81762c79-b462-4839-b7b3-13eea7ef884c%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/CAKokUHCu0WEcTjCBKqg3-2Nd6%3DRr1DkfeBQhaqkon5Gt-Rv2dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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/81762c79-b462-4839-b7b3-13eea7ef884c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/r35UO_Ji4c8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/62100418-4F21-4EFB-B82F-66715256AE80%40beckweb.net.
> 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/CAKokUHD52%2BoUnn%2B-2T-JNANsZyU%2BsNX%3DhCf_-Fs9uorqMR9dHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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" 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/62100418-4F21-4EFB-B82F-66715256AE80%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


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 < 3; idx++)
{
lock(resource: 'parallel_test_' + idx + '_' + config.mylabel, label: 
'parallel_test_' + config.mylabel)
{
echo 'Create lock ' + 'parallel_test_' + idx + '_' + config.
ansibleEnvLabel
}
}

for (int testIdx = 0; testIdx < stageStep.tests.size(); testIdx++)
{
def test = steps.tests[testIdx]
def testFullName = "${Parallel_${test.testName}_${testIdx}"
parallelJobsToExecute[testFullName] = {
lock(label: 'parallel_test_' + config.mylabel, quantity: 1)
{
node('ansible')
{ 



However this doesn't work because first loop cannot create lock with 
resource name and label together. I'm getting this error:

java.lang.IllegalArgumentException: Label and resource name cannot be specified 
simultaneously.

Is there a achieve that ?

Kamil 



-- 
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/a18e1579-0ce2-40df-b4dc-5d375df4b7e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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... But I'm unable to copy anything...

Example:

node('master') {
stage("Produce data") {
build('test.producer')
}

stage("Collect data") {
unarchive(mapping: ['file.txt': 'file.txt'])
readProperties('file.txt')
echo "Variable value: ${DATA}"
}
}


I tried everything... stash and unstash, unarchive, etc... What I'm doing 
wrong?

The 'test.producer' job creates a file that is expected to be copied at the 
Collect stage.

This is the output:

[Pipeline] nodeRunning on master in 
/var/jenkins_home/jobs/test.pipeline/workspace[Pipeline] {[Pipeline] 
stage[Pipeline] { (Produce data)[Pipeline] build (Building 
test.producer)Scheduling project: test.producer 


Starting building: test.producer #7 
[Pipeline] }[Pipeline] // 
stage[Pipeline] stage[Pipeline] { (Collect data)[Pipeline] unarchive[Pipeline] 
}[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] End of 
PipelineERROR: no artifacts to unarchive in file.txtFinished 
: FAILURE


with stash

Started by user anonymous [Pipeline] 
nodeRunning on master in 
/var/jenkins_home/jobs/test.pipeline/workspace[Pipeline] {[Pipeline] 
stage[Pipeline] { (Produce data)[Pipeline] build (Building 
test.producer)Scheduling project: test.producer 

Starting building: test.producer #4 
[Pipeline] stash[Pipeline] 
}[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] End of 
PipelineERROR: No files included in stashFinished 
: FAILURE


Thanks for the help you can provide me

-- 
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/f95ef25a-c8d7-4e3d-9eb9-27b4280f12d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 {
> if (currentBuild.result == 'UNSTABLE'){
> currentBuild.result = 'STABLE'
> }
> currentBuild.result = 'SUCCESS'
> }
> }
> }
>
>
> All i need is just to set build to SUCCESS even if it is UNSTABLE.
>
> JUNIT step produces currentBuild.result = UNSTABLE  < this is ok..
>
> at the end I need to change status to succes. I tried all possible
> combinations.
> If I do:
>
> post {
> always {
> script {
> if (currentBuild.result == 'UNSTABLE'){
> currentBuild.result = 'SUCCESS'
> }
> }
> }
> }
>
> It does nothing and build is yellow
>
> If I do:
>
> post {
> always {
> script {
> if (currentBuild.result == 'UNSTABLE'){
> currentBuild.result = 'STABLE'
> }
> }
> }
> }
>
> All steps change to  green/blue  (that is correct) but overal build is
>  FAILURE
>
>
> I'm out of ideas and it seems to me as a bug.
>
> If I do nothing in postbuild full build is marked as  'UNSTABLE'
>
> thanks for any ideas
>
> --
> 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/f2eac395-838e-4421-b9b8-ec9a7308cc31%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Dick Ginga
Build Engineer
rgi...@disruptorbeam.com

-- 
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/CAL3PpaWLBkZQPWui_fCV-f5LgT46Cach1ojixN-sZi1L7wSs-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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,
~Bill

-- 
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/CAC7g-J3iyDnfDAwHKvjcc1xZsP1eZcJA8%2BKpJt8LvzxspaPfOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 those two pipelines - however I'm getting 
deadlock here.

ALL
lock('env_lock_name')
{
stage ('DEPLOY')
{
build job: 'DEPLOY'
}

stage ('TEST')
{
build job: 'TEST'
}
}

DEPLOY:
lock('env_lock_name')
{
stage ('DEPLOY')
{
echo 'DEPLOY'
}
}

TEST:
lock('env_lock_name')
{
stage ('TEST')
{
echo 'TEST'
}
}

Pipelines TEST and DEPLOY can be executed standalone so they need lock too.

I want to have lock in 'ALL' pipeline to ensure that nothing will get 
executed between DEPLOY and TEST at this env.

Logic of reentrant lock would resolve it. Do you have something similar 
already at your roadmap? Any ideas what would be a 'workaround' for now?

I could use shared library to move deploy there as a function and call it 
from two places but I would like to have history of deployments in one 
place under DEPLOY pipeline history.

Regards

Kamil


-- 
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/b326db40-9896-4a9c-958d-17989be953a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

Joaquin

-- 
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/374117c1dcb94cfebe627bd413fa48fe%40BSKEXCH2013HYPV.mwrinfosecurity.com.
For more options, visit https://groups.google.com/d/optout.


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
ecosystem and the newest trends in Continuous Integration, Continuous
Delivery and automation in general. Jenkins CI users and developers of all
experience levels are invited.

*B.Y.O.L*
This is not the usual conference: the interactive sessions give you a
unique opportunity to learn hands-on, following along with an instructor
step-by-step.
So just bring your own laptop (BYOL)!

*Take Stage!*
There are still a few slots open in the program for presentations and
workshops.
If you have anything you would like to share, just use this Call for Paper
form .

Hope you will join us in Gothenburg and/or Oslo!
[image: ]
Adam Henriques
Sales & Marketing
a...@praqma.net
+45 28 12 90 94 <+45%2028%2012%2090%2094>
Skype: adamhenriques
Praqma
www.praqma.com
DK: CPH, Aarhus, Allerod
NO: OSL
SE: STHLM
+45 36 PRAQMA <+4536772762>


-- 
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/CAFSnbEL-Zd5mo-6e%3DpE%3Dfsm652V%2BDOPbiMBws-Kf8N%3DsKttqxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 several of these exceptions.

What is this exactly about? I am concerned about my builds if they are 
indeed valid. In spite of this exception the build carries forward and 
finishes successfully.
A restart of the node seemed to help.

-- 
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/93d52f70-119a-450e-9ca9-d85c088c68af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Accessing Jenkins proxy settings in pipeline script?

2017-03-28 Thread 'Robin Müller' via Jenkins Users
Hi everyone,

is there already a way to access the Jenkins proxy settings within a 
pipeline script?
If not I could imagine to have a global variable similar to scm that can be 
used for this purpose. I think a good place for such a variable would be 
the workflow-basic-steps-plugin.

Regards,
Robin

-- 
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/4ed50f7c-7949-4396-bf19-5c89c6b2d9f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.