DS
Size: a a a
DS
r
r
RT
DS
DS
RT
RT
[Pipeline] sh
Warning: A secret was passed to "sh" using Groovy String interpolation, which is insecure.
Affected argument(s) used the following variable(s): [PASSWD]
See https://jenkins.io/redirect/groovy-string-interpolation for details.
DB
r
DB
B
HC
DS
node {```
withCredentials([usernamePassword(credentialsId: 'test',
usernameVariable: 'USERNAME',
passwordVariable: 'PASSWORD')]) {
sh 'env | grep -E "USERNAME|PASSWORD"'
sh 'echo "$USERNAME - $PASSWORD"> pass.txt'
sh 'cat pass.txt'
}
}
14:12:45 [Pipeline] withCredentials
14:12:45 Masking supported pattern matches of $USERNAME or $PASSWORD
14:12:45 [Pipeline] {
14:12:45 [Pipeline] sh
14:12:45 + env
14:12:45 + grep -E 'USERNAME|PASSWORD'
14:12:45 USERNAME=****
14:12:45 PASSWORD=****
14:12:46 [Pipeline] sh
14:12:46 + echo '**** - ****'
14:12:46 [Pipeline] sh
14:12:47 + cat pass.txt
14:12:47 **** - ****
14:12:47 [Pipeline] }
14:12:47 [Pipeline] // withCredentials
14:12:47 [Pipeline] }
14:12:47 [Pipeline] // node
14:12:48 [Pipeline] End of Pipeline
U
DS
AS
pipeline {
agent any
stages {
stage('Hello') {
steps {
withCredentials([usernamePassword(credentialsId: 'test', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME')]) {
sh 'echo l/p: $USERNAME/$PASSWORD'
}
}
}
}
}
RT
AS
RT