projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Jenkins user to Docker image earlier
[osm/devops.git]
/
jenkins
/
ci-pipelines
/
ci_stage_2.groovy
diff --git
a/jenkins/ci-pipelines/ci_stage_2.groovy
b/jenkins/ci-pipelines/ci_stage_2.groovy
index
6db004c
..
45bf777
100644
(file)
--- a/
jenkins/ci-pipelines/ci_stage_2.groovy
+++ b/
jenkins/ci-pipelines/ci_stage_2.groovy
@@
-39,22
+39,18
@@
def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system) {
}
stage('License Scan') {
}
stage('License Scan') {
-
ba
sh "devops/tools/license_scan.sh"
+ sh "devops/tools/license_scan.sh"
}
container_name = "${project}-${branch}".toLowerCase()
stage('Docker-Build') {
}
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}") {
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'
}
stage('Test') {
sh 'devops-stages/stage-test.sh'
}