Last active
May 31, 2017 17:42
-
-
Save mig82/ab6c0ee42881555de203ffa9fb06c774 to your computer and use it in GitHub Desktop.
A Jenkins job that passes a user and password and a secret file to another job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
properties([ | |
parameters([ | |
[ | |
$class: 'CredentialsParameterDefinition', | |
name: 'GIT_CREDENTIALS', | |
credentialType: 'com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl', | |
defaultValue: params.GIT_CREDENTIALS?params.GIT_CREDENTIALS:'', | |
description: 'Credentials for Github.', | |
required: true | |
], | |
[ | |
$class: 'CredentialsParameterDefinition', | |
name: 'ANDROID_KEYSTORE_FILE', | |
credentialType: 'org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl', | |
defaultValue: params.ANDROID_KEYSTORE_FILE?params.ANDROID_KEYSTORE_FILE:'', | |
description: 'The Android keystore (.jks or .keystore) file', | |
required: false | |
] | |
]) | |
]) | |
stage('echo'){ | |
echo(params.GIT_CREDENTIALS) | |
echo(params.ANDROID_KEYSTORE_FILE) | |
} | |
stage('call B'){ | |
build( | |
job: 'jobB', | |
propagate: true, | |
wait: true, | |
parameters: [ | |
[$class: "CredentialsParameterValue", name: "GIT_CREDENTIALS", value: "${params.GIT_CREDENTIALS}"], | |
[$class: "CredentialsParameterValue", name: "ANDROID_KEYSTORE_FILE", value: "${params.ANDROID_KEYSTORE_FILE}"] | |
] | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Passing credential parameters between jenkins jobs