Jenkins Pipeline to be generic

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Jenkins Pipeline to be generic

krish
Hi,

how can we use the multiple credentials into jenkins pipeline, in our environment diff applications have diff userid and password, is their a smarter way to define this in jenkins pipeline

thank you

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/fc1bcd9a-7fe0-4bef-ad9a-ad93c97e310b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins Pipeline to be generic

srivathsa.puliyala
You can useĀ withCredentials

https://jenkins.io/doc/pipeline/steps/credentials-binding/


On Thursday, April 12, 2018 at 3:06:19 PM UTC-4, krish wrote:
Hi,

how can we use the multiple credentials into jenkins pipeline, in our environment diff applications have diff userid and password, is their a smarter way to define this in jenkins pipeline

thank you

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d8855c70-3343-4fce-862c-1293ffb3ce1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins Pipeline to be generic

srivathsa.puliyala
For multiple usages of withCredentials:

node {
		withCredentials([[$class: 'UsernamePasswordMultiBinding',
				  credentialsId: "TokenID_1",
				  usernameVariable: 'USERNAME_1',
				  passwordVariable: 'PASSWORD_1']]) {
				  
				  stage('stage1'){
				  
				  <YOUR TASKS>
				  
				  }

		}
		withCredentials([[$class: 'UsernamePasswordMultiBinding',
				  credentialsId: "TokenID_2",
				  usernameVariable: 'USERNAME_2',
				  passwordVariable: 'PASSWORD_2']]) {
				  
				  stage('stage2'){
				  
				  <YOUR TASKS>
				  
				  }

		}
}



On Fri, Apr 13, 2018 at 6:12 PM, <[hidden email]> wrote:
You can useĀ withCredentials



On Thursday, April 12, 2018 at 3:06:19 PM UTC-4, krish wrote:
Hi,

how can we use the multiple credentials into jenkins pipeline, in our environment diff applications have diff userid and password, is their a smarter way to define this in jenkins pipeline

thank you

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d8855c70-3343-4fce-862c-1293ffb3ce1a%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAFB%2B0W6VLjZc5NTkgoEgW6OBWw7Q2WZjn%3DFD%2BwOGkXD8S5pxeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins Pipeline to be generic

krish
In reply to this post by krish
Thanks Guys. That works

On Thursday, 12 April 2018 15:06:19 UTC-4, krish wrote:
Hi,

how can we use the multiple credentials into jenkins pipeline, in our environment diff applications have diff userid and password, is their a smarter way to define this in jenkins pipeline

thank you

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/13b35b68-b640-404c-89bf-871788bd3824%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.