Re: Using the same label multiple times in pipeline

2017-10-30 Thread Daniel Becroft
Thanks for the reply, Robert and Daniel. The actual workspace that I get is
not an issue - I just need to get back to that agent in order to do some
cleanup.

My scenario is:
node('A') => create and initialize a database, and start it on the port.
Database is outside of the workspace, in a build# folder
node('B') => run the integration tests against that database
node('A') => stop and remove the database

This currently works as I only have a single node with a label of "a", but
we might be adding more.

Thanks again.

On Tue, Oct 31, 2017 at 12:51 AM Robert Hales  wrote:

> The ws{} block will not give a guarantee that you will get the same
> workspace. If, for example, 2 jobs run at the same time, they cannot use
> the workspace concurrently. The second one to request the workspace will
> get one with a @2 on the end. You would have to make sure multiple jobs
> can't run at the same time, or use resource locking to prevent concurrent
> use of the workspace.  If you don't care about concurrent use, then skip
> the ws{} and use dir{} instead. That will always use the same directory and
> doesn't care about multiple jobs accessing it.
>
>
> On Monday, October 30, 2017 at 3:05:03 AM UTC-6, Daniel Butler wrote:
>
>> Couple of approaches:
>>
>> You could use the External Workspace Manager plugin:
>> https://jenkins.io/doc/pipeline/steps/external-workspace-manager/
>>
>>
>>
>> Or as Robert suggested use the ws(){} block, this should give a guarantee
>> on the workspace but you’ll need to confirm that you’re not about to fill
>> up your node’s disks with old workspaces:
>>
>> Something along the lines of:
>> def sharedWorkspace = “/shared-workspace/${JOB_NAME}/${BUILD_NUMBER}”
>>
>> node(‘A’){
>>
>> ws(sharedWorkspace){
>>
>> //do stuff
>>
>> }
>>
>> }
>>
>> node(‘B’){}
>>
>> node(‘A’){
>>
>> ws(sharedWorkspace){
>>
>> //do more stuff
>>
>> }
>>
>> }
>>
>>
>>
>>
>>
>> *From: *Robert Hales
>> *Sent: *30 October 2017 03:04
>> *To: *Jenkins Users
>> *Subject: *Re: Using the same label multiple times in pipeline
>>
>>
>>
>> If you have multiple nodes with a label of A, you will need to declare a
>> variable to hold the name of the specific node you ended up on in the first
>> "node" declaration, and then use that node in the third one:
>>
>>
>>
>> def allocatedNode
>>
>>
>>
>> node('A') { allocatedNode = $NODE_NAME } //NODE_NAME is an environment
>> variable provided by Jenkins
>>
>> node('B') {}
>>
>> node($NODE_NAME) {}
>>
>>
>>
>>
>>
>> HOWEVER, be aware that this isn't always a safe thing to do, depending on
>> what your goal is. There is no guarantee that the workspace that was used
>> in the first node block will still be there when the third block gets
>> there. Even if it is, there is no guarantee that the third block will use
>> the original workspace. It probably will most of the time, but not
>> guaranteed. Depending on what you are doing, you may need to allocate a
>> custom workspace (still not a guaranteed solution), move to a separate
>> directory, stash/unstash the things you need between nodes, or some other
>> solution.
>>
>> On Sunday, October 29, 2017 at 8:51:02 PM UTC-6, Daniel Becroft wrote:
>>
>> Hi,
>>
>> I'm experimenting with the scripted pipeline, and have a question about
>> the use of node('') with a label. If I have the following scenario:
>>
>>
>>
>> node('A') { }
>>
>> node('B') { }
>>
>> node('A') { // Which node will be used here? }
>>
>>
>>
>> Is there any guarantee that the second node() step for "A" will hit the
>> same slave as the first one, or will it use whichever slave is now
>> available? I'd like for the first node() to allocate one from the pool of
>> slaves with the label of "A", but then the second one to somehow reuse the
>> first one (there might be some cleanup tasks, etc that need to happen on
>> the original node).
>>
>>
>>
>> Cheers,
>>
>> Daniel B.
>>
>>
>>
>> --
>> 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/f43a48c1-15bd-4feb-9a91-3e818a3cf268%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/60f2e5ee-df59-4785-a7ed-2e5a656aa861%40googlegroups.com
> 

Jenkins SAML + Azure AD

2017-10-30 Thread Ivan Fernandez Calvo
It never gonna work Azurre cannot reach your service 
http://localhost:/securityRealm/finishLogin to send the SAMLResponse, both 
machines have to have visibility it is a basic premise for SAML

-- 
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/6d4b6884-f2be-4282-b36a-29bedb23bc24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using the same label multiple times in pipeline

2017-10-30 Thread Robert Hales
The ws{} block will not give a guarantee that you will get the same 
workspace. If, for example, 2 jobs run at the same time, they cannot use 
the workspace concurrently. The second one to request the workspace will 
get one with a @2 on the end. You would have to make sure multiple jobs 
can't run at the same time, or use resource locking to prevent concurrent 
use of the workspace.  If you don't care about concurrent use, then skip 
the ws{} and use dir{} instead. That will always use the same directory and 
doesn't care about multiple jobs accessing it. 


On Monday, October 30, 2017 at 3:05:03 AM UTC-6, Daniel Butler wrote:
>
> Couple of approaches:
>
> You could use the External Workspace Manager plugin: 
> https://jenkins.io/doc/pipeline/steps/external-workspace-manager/
>
>  
>
> Or as Robert suggested use the ws(){} block, this should give a guarantee 
> on the workspace but you’ll need to confirm that you’re not about to fill 
> up your node’s disks with old workspaces: 
>
> Something along the lines of:
> def sharedWorkspace = “/shared-workspace/${JOB_NAME}/${BUILD_NUMBER}”
>
> node(‘A’){
>
> ws(sharedWorkspace){
>
> //do stuff
>
> }
>
> }
>
> node(‘B’){}
>
> node(‘A’){
>
> ws(sharedWorkspace){
>
> //do more stuff
>
> }
>
> }
>
>  
>
>  
>
> *From: *Robert Hales 
> *Sent: *30 October 2017 03:04
> *To: *Jenkins Users 
> *Subject: *Re: Using the same label multiple times in pipeline
>
>  
>
> If you have multiple nodes with a label of A, you will need to declare a 
> variable to hold the name of the specific node you ended up on in the first 
> "node" declaration, and then use that node in the third one: 
>
>  
>
> def allocatedNode
>
>  
>
> node('A') { allocatedNode = $NODE_NAME } //NODE_NAME is an environment 
> variable provided by Jenkins
>
> node('B') {}
>
> node($NODE_NAME) {}
>
>  
>
>  
>
> HOWEVER, be aware that this isn't always a safe thing to do, depending on 
> what your goal is. There is no guarantee that the workspace that was used 
> in the first node block will still be there when the third block gets 
> there. Even if it is, there is no guarantee that the third block will use 
> the original workspace. It probably will most of the time, but not 
> guaranteed. Depending on what you are doing, you may need to allocate a 
> custom workspace (still not a guaranteed solution), move to a separate 
> directory, stash/unstash the things you need between nodes, or some other 
> solution. 
>
> On Sunday, October 29, 2017 at 8:51:02 PM UTC-6, Daniel Becroft wrote:
>
> Hi,
>
> I'm experimenting with the scripted pipeline, and have a question about 
> the use of node('') with a label. If I have the following scenario:
>
>  
>
> node('A') { }
>
> node('B') { }
>
> node('A') { // Which node will be used here? }
>
>  
>
> Is there any guarantee that the second node() step for "A" will hit the 
> same slave as the first one, or will it use whichever slave is now 
> available? I'd like for the first node() to allocate one from the pool of 
> slaves with the label of "A", but then the second one to somehow reuse the 
> first one (there might be some cleanup tasks, etc that need to happen on 
> the original node).
>
>  
>
> Cheers,
>
> Daniel B.
>
>  
>
> -- 
> 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/f43a48c1-15bd-4feb-9a91-3e818a3cf268%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/60f2e5ee-df59-4785-a7ed-2e5a656aa861%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Get git commit sha from other Jobs

2017-10-30 Thread Raul Ferriz
Hi

I have two jobs: Job1 and Job2 (both are pipelines written as Jenkinfile).

Job1 is responsible for testing and building documentation.
Job2 is responsible for deploying.

Job1 can be run multiple times on the same branch and be run on other 
branches, may be even on distinct commit sha.

When I launch Job2, I need to setup an input list field populated with the 
builds of Job1.

For example:

Job1 builds:
build: 100   branch: branch1commit sha: 1234567
build: 101   branch: branch2commit sha: abcdefg
build: 102   branch: branch1commit sha: a1b2c3d
build: 103   branch: branch3commit sha: e1d1d1d

I need to build an input list with:
100 - branch1
101 - branch2
102 - branch1
103 - branch3


And when I select "102 - branch1" I need to be able to get the stored 
"a1b2c3d" so I can release exactly this version.

I have built the Job1 without any problem, but I'm having lots of problems 
building Job2.

1) I don't know how can I get  the exact commit where a external build has 
been run (and I cannot find anywhere on the web how to achieve it)


I'm playing with this code on Groovy console, but I could not find where 
the commit is stored:


import hudson.matrix.*
> import jenkins.model.*;
> import com.cloudbees.hudson.plugins.folder.*
> import jenkins.branch.*
>
> String propName = 'name'
> def filtered = ['class', 'active']
>
> def getPropertiesFrom(obj) {
>   try {
>   obj.metaClass.properties.findAll { it.name != 'class' && it.name != 
> 'metaClass' }.inject([:]) { acc, e -> acc[e.name] = e.getProperty(obj); acc 
> }
>   } catch(err) {
> return 'ERROR'
>   }
> }
>
> Jenkins.getInstance().getAllItems().each { 
>   def my = it
>   // MavenModule is superfluous project returned by getAllItems()
>   if (!(it instanceof MatrixConfiguration)) {
> println '-->' + it
>
> println getPropertiesFrom(it)
>
> if (it.hasProperty(propName) && it."$propName") {
> println 'name: ' + it."$propName"
> }
> //if (it.hasProperty('SCMs') && it.SCMs) {
> //  println '\n' + '===' + getPropertiesFrom(it.SCMs[0])
> //}
>   }
>   println ''
> }
>

Where is stored the commit sha?

Note: Job1 project is an instance of 
'org.jenkinsci.plugins.workflow.job.WorkflowJob'

-- 
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/890453ea-9b9f-4aa9-a846-3fe6423977d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Weekly build Jenkins 2.87 is not available for download

2017-10-30 Thread Daniel Beck

> On 30. Oct 2017, at 14:28, Masaru Tsuchiyama  wrote:
> 
> Weekly build Jenkins 2.87 is not available for download
> at https://jenkins.io/download/

Thanks, I filed https://issues.jenkins-ci.org/browse/INFRA-1382

-- 
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/06D7E373-361F-46E6-A3B6-F988FB2D8C82%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Weekly build Jenkins 2.87 is not available for download

2017-10-30 Thread Masaru Tsuchiyama

Hi

Weekly build Jenkins 2.87 is not available for download
at https://jenkins.io/download/

But the site is referring to the version as 'Download Jenkins 2.87 for'.


Masaru Tsuchiyama

--
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/0d6126e4-d2c7-afaa-77c8-47b3e8298f0f%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins Plugin Manager Page | Stack Trace errored out

2017-10-30 Thread LnT
Hi,

My Jenkins version 1.580

I have tried to open plugin manager page ...Which is showing Stack Trace 
error page and below it lists plugins available for update.
Not able to navigate tables -> Installed or Available

PFA log.

Please show me some light - which causes this issue.

Regards,
LnT

-- 
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/ab8fa879-184c-4493-9a38-a9bc2bb039bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Stack trace
javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: 
jar:file:/C:/Users/RobertoGa/.jenkins/war/WEB-INF/lib/jenkins-core-1.580.jar!/hudson/PluginManager/table.jelly:74:52:
  java.lang.StackOverflowError
at 
org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:117)
at 
org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:127)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:717)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
at org.kohsuke.stapler.MetaClass$3.doDispatch(MetaClass.java:182)
at 
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631)
at org.kohsuke.stapler.Stapler.service(Stapler.java:225)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
at 
hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:58)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at 
hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:86)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at 
hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at 
org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at 
hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(Scope

Re: error"Invalid login information. Please try again. Try again" for matrix based security

2017-10-30 Thread gnaga . mail12
I am also same issues facing.how to fix these issue.

On Tuesday, June 28, 2016 at 4:40:34 AM UTC-7, Abhijit Zanak wrote:
>
> I have applied matrix based security also added users into credentials , 
> however when I tried to log in getting following error,checked the server 
> log as well there is no fruitful information .
>
> Invalid login information. Please try again. 
> Try again 
>  
> If you are a system administrator and suspect this to be a configuration 
> problem, see the server console output for more details.
>
>
>
>
>

-- 
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/18009a0d-39db-40e3-ba31-3b4fdf24905e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins SAML + Azure AD

2017-10-30 Thread jan . gazda
Hi, I'm trying to configure SAML authentication with Jenkins via Azure AD.
Right now I'm running Jenkins in Docker on my local machine to prevent 
locking out myself from our prod.


I'm using this plugin: 
https://wiki.jenkins.io/display/JENKINS/SAML+Plugin

I did all configuration in Jenkins and I'm still receiving an exception.

My config in AAD:
*Identifier:* http://localhost:/securityRealm/finishLogin

*Reply URLs:* https://localhost:/securityRealm/finishLogin, 
http://localhost:/securityRealm/finishLogin

I downloaded Metadata and pasted it in Jenkins.
Can someone please give me a tip how to debug this issue? 

The error I'm receiving is:

org.pac4j.saml.exceptions.SAMLException: No valid subject assertion found in 
response
at 
org.pac4j.saml.sso.impl.SAML2DefaultResponseValidator.validateSamlSSOResponse(SAML2DefaultResponseValidator.java:313)
at 
org.pac4j.saml.sso.impl.SAML2DefaultResponseValidator.validate(SAML2DefaultResponseValidator.java:138)
at 
org.pac4j.saml.sso.impl.SAML2WebSSOMessageReceiver.receiveMessage(SAML2WebSSOMessageReceiver.java:77)
at 
org.pac4j.saml.sso.impl.SAML2WebSSOProfileHandler.receive(SAML2WebSSOProfileHandler.java:35)



-- 



-- 
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/080658a5-35b3-4225-9b64-57411880690b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: issue using jenkins swarm client "Failed to fetch slave info from Jenkins CODE: 403 Retrying in 10 seconds"

2017-10-30 Thread Abhi adr
Hi Xinity,

did you able to solve this error , i am facing the same issue tried to 
replace the jar file but still getting this error .

please reply me if solve this issue or guide me how you solve it !



Thanks 

--Abhi

On Monday, February 13, 2017 at 3:20:46 PM UTC+5:30, Xinity wrote:
>
> Hi there,
> i'm trying to use jenkins swarm client to do automatic discover of agents 
> in my internal network.
>
> We have deployed latest version of jenkins with needed plugins and we are 
> trying to configure jenkins so our swarm client can auth using 
> login/password provided.
> We've tried to use role based strategy plugin thinking it would ease our 
> job, but we may have missing something as we have found the exact roles to 
> give to the user used to auth.
>
> Auth seems to be ok , but we still have these messages: 
> Failed to fetch slave info from Jenkins CODE: 403
> Retrying in 10 seconds
>
> anyone may give tips ? :)
>
> Thanks a lot for your 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/607eef5f-7d97-4a20-8dae-145189e4e5c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Using the same label multiple times in pipeline

2017-10-30 Thread Daniel Butler
Couple of approaches:

You could use the External Workspace Manager plugin: 
https://jenkins.io/doc/pipeline/steps/external-workspace-manager/

Or as Robert suggested use the ws(){} block, this should give a guarantee on 
the workspace but you’ll need to confirm that you’re not about to fill up your 
node’s disks with old workspaces: 
Something along the lines of:
def sharedWorkspace = “/shared-workspace/${JOB_NAME}/${BUILD_NUMBER}”
node(‘A’){
ws(sharedWorkspace){
//do stuff
}
}
node(‘B’){}
node(‘A’){
ws(sharedWorkspace){
//do more stuff
}
}

 

From: Robert Hales
Sent: 30 October 2017 03:04
To: Jenkins Users
Subject: Re: Using the same label multiple times in pipeline

If you have multiple nodes with a label of A, you will need to declare a 
variable to hold the name of the specific node you ended up on in the first 
"node" declaration, and then use that node in the third one: 

def allocatedNode

node('A') { allocatedNode = $NODE_NAME } //NODE_NAME is an environment variable 
provided by Jenkins
node('B') {}
node($NODE_NAME) {}


HOWEVER, be aware that this isn't always a safe thing to do, depending on what 
your goal is. There is no guarantee that the workspace that was used in the 
first node block will still be there when the third block gets there. Even if 
it is, there is no guarantee that the third block will use the original 
workspace. It probably will most of the time, but not guaranteed. Depending on 
what you are doing, you may need to allocate a custom workspace (still not a 
guaranteed solution), move to a separate directory, stash/unstash the things 
you need between nodes, or some other solution. 

On Sunday, October 29, 2017 at 8:51:02 PM UTC-6, Daniel Becroft wrote:
Hi,
I'm experimenting with the scripted pipeline, and have a question about the use 
of node('') with a label. If I have the following scenario:

node('A') { }
node('B') { }
node('A') { // Which node will be used here? }

Is there any guarantee that the second node() step for "A" will hit the same 
slave as the first one, or will it use whichever slave is now available? I'd 
like for the first node() to allocate one from the pool of slaves with the 
label of "A", but then the second one to somehow reuse the first one (there 
might be some cleanup tasks, etc that need to happen on the original node).

Cheers,
Daniel B.

-- 
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/f43a48c1-15bd-4feb-9a91-3e818a3cf268%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/59f6eb23.c8e1500a.573c1.f1ae%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multibranch Pipeline - GIT - SSH authentication

2017-10-30 Thread Samuel Mutel
It works now with Git Plugin 3.6.3. 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/e042ee8e-61a9-4c84-9da4-2088972a4ff6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.