From: Mike Marchetti Date: Sat, 9 Sep 2017 18:42:55 +0000 (-0400) Subject: add jenkin user to dockerfile on build X-Git-Tag: v3.0.0rc~11 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F55%2F2155%2F1;p=osm%2Fdevops.git add jenkin user to dockerfile on build Change-Id: I47fc730d27ff852d94b024be4e11adf3817aa011 Signed-off-by: Mike Marchetti --- diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index 45cbc7d6..7fca49d1 100644 --- a/jenkins/ci-pipelines/ci_stage_2.groovy +++ b/jenkins/ci-pipelines/ci_stage_2.groovy @@ -45,16 +45,14 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system) { container_name = "${project}-${branch}".toLowerCase() stage('Docker-Build') { + sh ''' + echo RUN groupadd -o -g $(id -g) -r jenkins >> Dockerfile + echo RUN useradd -o -u $(id -u) --create-home -r -g jenkins jenkins >> Dockerfile + ''' sh "docker build -t ${container_name} ." } withDockerContainer("${container_name}") { - stage('Docker-Setup') { - sh ''' - groupadd -o -g $(id -g) -r jenkins - useradd -o -u $(id -u) --create-home -r -g jenkins jenkins - ''' - } stage('Test') { sh 'devops-stages/stage-test.sh' }