From 63bb0dcf08d3ddcdc7f00567dcebd960451ff19e Mon Sep 17 00:00:00 2001 From: William Petit Date: Fri, 20 Mar 2020 17:00:30 +0100 Subject: [PATCH] cpkg: fix random failure with GIT_ASKPASS script --- vars/cpkg.groovy | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/vars/cpkg.groovy b/vars/cpkg.groovy index 076bc62..3fd8567 100644 --- a/vars/cpkg.groovy +++ b/vars/cpkg.groovy @@ -94,18 +94,16 @@ def call(Map params = [:]) { def randomUUID = UUID.randomUUID().toString() def tmpAskPassScript = pwd(tmp:true) + "/${randomUUID}" try { - node { - writeFile( - file: tmpAskPassScript, - text: ''' - #!/bin/sh - case "$1" in - Username*) echo $GIT_USERNAME ;; - Password*) echo $GIT_PASSWORD ;; - esac - ''' - ) - } + writeFile( + file: tmpAskPassScript, + text: ''' + #!/bin/sh + case "$1" in + Username*) echo $GIT_USERNAME ;; + Password*) echo $GIT_PASSWORD ;; + esac + ''' + ) sh(script: "git config user.email '${gitEmail}'") sh(script: "git config user.name '${gitUsername}'") sh(script: "chmod +x '${tmpAskPassScript}'")