Jenkinsfile: this is yet another try with environment variables

Project: http://git-wip-us.apache.org/repos/asf/logging-log4net/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4net/commit/fd7c10d6
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4net/tree/fd7c10d6
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4net/diff/fd7c10d6

Branch: refs/heads/develop
Commit: fd7c10d6a77c3dac3edcd48f23c167b7c658ac30
Parents: 83d2b87
Author: Dominik Psenner <dpsen...@apache.org>
Authored: Tue Jul 18 17:47:46 2017 +0200
Committer: Dominik Psenner <dpsen...@apache.org>
Committed: Tue Jul 18 17:47:46 2017 +0200

----------------------------------------------------------------------
 Jenkinsfile                                      | 18 +++++++-----------
 buildtools/docker/builder-netstandard/Dockerfile |  7 +++----
 2 files changed, 10 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/fd7c10d6/Jenkinsfile
----------------------------------------------------------------------
diff --git a/Jenkinsfile b/Jenkinsfile
index 4530268..10ce384 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -22,6 +22,7 @@ pipeline {
                timeout(time: 1, unit: 'HOURS')
                buildDiscarder(logRotator(numToKeepStr: '3'))
                skipDefaultCheckout()
+               disableConcurrentBuilds()
        }
        agent {
                label 'ubuntu'
@@ -36,12 +37,10 @@ pipeline {
                        steps {
                                deleteDir()
                                checkout scm
-                               script {
-                                       JENKINS_UID = sh(returnStdout: true, 
script: 'stat -c "%u" .').trim()
-                                       JENKINS_GID = sh(returnStdout: true, 
script: 'stat -c "%g" .').trim()
-                                       echo $JENKINS_UID
-                                       echo $JENKINS_GID
-                               }
+                               sh '''
+                                       export JENKINS_UID=`stat -c "%u" .`
+                                       export JENKINS_GID=`stat -c "%g" .`
+                               '''
                        }
                }
 
@@ -50,15 +49,12 @@ pipeline {
                        agent {
                                dockerfile {
                                        dir 
'buildtools/docker/builder-netstandard'
-                                       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}'
+                               sh 'echo ${JENKINS_UID}'
+                               sh 'echo ${JENKINS_GID}'
 
                                checkout scm
 

http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/fd7c10d6/buildtools/docker/builder-netstandard/Dockerfile
----------------------------------------------------------------------
diff --git a/buildtools/docker/builder-netstandard/Dockerfile 
b/buildtools/docker/builder-netstandard/Dockerfile
index 5610806..2c5f9dc 100644
--- a/buildtools/docker/builder-netstandard/Dockerfile
+++ b/buildtools/docker/builder-netstandard/Dockerfile
@@ -1,14 +1,13 @@
 # Name of container: docker-ubuntu-latest-nant
 FROM microsoft/dotnet
 
-# define arguments
-ARG JENKINS_UID
-ARG JENKINS_GID
+# define arguments passed in as environment variables
+ENV JENKINS_UID
+ENV JENKINS_GID
 
 # set the maintainer of this docker image
 MAINTAINER "d...@logging.apache.org"
 
-RUN echo "$(pwd)"
 RUN echo $JENKINS_UID
 RUN echo $JENKINS_GID
 

Reply via email to