From: marchettim Date: Sat, 9 Sep 2017 14:12:54 +0000 (+0200) Subject: Revert "Add Jenkins user to Docker image earlier" X-Git-Tag: v3.0.0rc~12 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=9a7634f760eac073973a2818f09b2fed725330ef;p=osm%2Fdevops.git Revert "Add Jenkins user to Docker image earlier" This reverts commit dda707b51e8ce223a59d454dbd3f5a43f212b2ac. Change-Id: I8129da9c306d202e722306341d6243b710eb5a31 --- diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index 45bf777e..45cbc7d6 100644 --- a/jenkins/ci-pipelines/ci_stage_2.groovy +++ b/jenkins/ci-pipelines/ci_stage_2.groovy @@ -45,12 +45,16 @@ 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".execute().text + " -r jenkins \\' >> Dockerfile" - sh "echo ' && useradd -o -u " + "id -u".execute().text + " --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' }