Jenkinsfile: yet another try to work out a syntax that works
Project: http://git-wip-us.apache.org/repos/asf/logging-log4net/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4net/commit/40011854 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4net/tree/40011854 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4net/diff/40011854 Branch: refs/heads/develop Commit: 400118549a89bbf97545a1ea9767ada76feff44a Parents: 9f2527b Author: Dominik Psenner <dpsen...@apache.org> Authored: Tue Jul 18 17:28:41 2017 +0200 Committer: Dominik Psenner <dpsen...@apache.org> Committed: Tue Jul 18 17:28:41 2017 +0200 ---------------------------------------------------------------------- Jenkinsfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/40011854/Jenkinsfile ---------------------------------------------------------------------- diff --git a/Jenkinsfile b/Jenkinsfile index dbdca76..1524d40 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,10 +32,10 @@ pipeline { steps { deleteDir() checkout scm - sh 'export JENKINS_UID=`stat -c "%u" ${env.WORKSPACE}`' - sh 'export JENKINS_GID=`stat -c "%g" ${env.WORKSPACE}`' - sh 'echo $JENKINS_UID' - sh 'echo $JENKINS_GID' + def JENKINS_UID = sh(returnStdout: true, script: 'stat -c "%u" ${env.WORKSPACE}').trim() + def JENKINS_GID = sh(returnStdout: true, script: 'stat -c "%g" ${env.WORKSPACE}').trim() + echo $JENKINS_UID + echo $JENKINS_GID } } @@ -44,11 +44,13 @@ pipeline { agent { dockerfile { dir 'buildtools/docker/builder-netstandard' - args '--build-arg JENKINS_UID=$JENKINS_UID --build-arg JENKINS_GID=$JENKINS_GID' + args "--build-arg JENKINS_UID=$JENKINS_UID --build-arg JENKINS_GID=$JENKINS_GID" reuseNode true } } steps { + echo $JENKINS_UID + echo $JENKINS_GID sh 'echo ${env.JENKINS_UID}' sh 'echo ${env.JENKINS_GID}'