From 9a7634f760eac073973a2818f09b2fed725330ef Mon Sep 17 00:00:00 2001 From: marchettim Date: Sat, 9 Sep 2017 16:12:54 +0200 Subject: [PATCH] Revert "Add Jenkins user to Docker image earlier" This reverts commit dda707b51e8ce223a59d454dbd3f5a43f212b2ac. Change-Id: I8129da9c306d202e722306341d6243b710eb5a31 --- jenkins/ci-pipelines/ci_stage_2.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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' } -- 2.25.1