cpkg: fix random failure with GIT_ASKPASS script

This commit is contained in:
wpetit 2020-03-20 17:00:30 +01:00
parent 0bef6cf450
commit 63bb0dcf08
1 changed files with 10 additions and 12 deletions

View File

@ -94,18 +94,16 @@ def call(Map params = [:]) {
def randomUUID = UUID.randomUUID().toString() def randomUUID = UUID.randomUUID().toString()
def tmpAskPassScript = pwd(tmp:true) + "/${randomUUID}" def tmpAskPassScript = pwd(tmp:true) + "/${randomUUID}"
try { try {
node { writeFile(
writeFile( file: tmpAskPassScript,
file: tmpAskPassScript, text: '''
text: ''' #!/bin/sh
#!/bin/sh case "$1" in
case "$1" in Username*) echo $GIT_USERNAME ;;
Username*) echo $GIT_USERNAME ;; Password*) echo $GIT_PASSWORD ;;
Password*) echo $GIT_PASSWORD ;; esac
esac '''
''' )
)
}
sh(script: "git config user.email '${gitEmail}'") sh(script: "git config user.email '${gitEmail}'")
sh(script: "git config user.name '${gitUsername}'") sh(script: "git config user.name '${gitUsername}'")
sh(script: "chmod +x '${tmpAskPassScript}'") sh(script: "chmod +x '${tmpAskPassScript}'")