I found a way with "withCredentials" function ...

withCredentials([
  string(credentialsId: 'XX-XX-XX-XX-XX-XX', variable: 'DCOS_PRIVATE_KEY')
]) {
  marathon(
    url: 'http://XX.XX.XX.XX:8080',
    forceUpdate: false,
    credentialsId: 
'{"uid":"cicd","login_endpoint":"${env.DCOS_ENDPOINT}","scheme":"RS256","private_key":"$DCOS_PRIVATE_KEY"}'
,
    filename: 'Marathon.json'
  )
}


Le mercredi 14 février 2018 10:38:02 UTC+1, Samuel Mutel a écrit :
>
> Hello,
>
> In the jenkins documentation I found this way to specify the credentials 
> in marathon deployment:
>
> credentialsId: 
> '{"uid":"jenkins","login_endpoint":"https://leader.mesos/acs/api/v1/auth/login","scheme":"RS256","private_key":"-----BEGIN
>  RSA PRIVATE KEY-----\nMIIEpAI..."}'
>
>
> It works fine but ... is it possible to store these credentials in the 
> credentials part of jenkins and use a credential id in the pipeline?
>
>
> Thanks.
>
> Regards.
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7d989331-464c-4c90-9b9c-9f492e35ad99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to