diff options
| author | Laurent Bonnans <laurent.bonnans@here.com> | 2018-06-27 11:13:06 +0200 |
|---|---|---|
| committer | Laurent Bonnans <laurent.bonnans@here.com> | 2018-09-06 11:45:07 +0200 |
| commit | 1b3616e68408a881df58e1bb806bc9c78828f779 (patch) | |
| tree | 11d1a7902ac1fb866284a5ef0e1b7693e02e1338 /scripts/ci/Jenkinsfile.bleeding | |
| parent | 7023fdda425f9d5e3b48e2cd12f961c0060ace54 (diff) | |
| download | meta-updater-1b3616e68408a881df58e1bb806bc9c78828f779.tar.gz | |
Create a user with correct uid inside CI's Dockerfile
Diffstat (limited to 'scripts/ci/Jenkinsfile.bleeding')
| -rw-r--r-- | scripts/ci/Jenkinsfile.bleeding | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/ci/Jenkinsfile.bleeding b/scripts/ci/Jenkinsfile.bleeding index f4d8883..e50b4b6 100644 --- a/scripts/ci/Jenkinsfile.bleeding +++ b/scripts/ci/Jenkinsfile.bleeding | |||
| @@ -1,8 +1,16 @@ | |||
| 1 | // This CI setup checks out aktualizr, meta-updater and updater-repo and builds | 1 | // This CI setup checks out aktualizr, meta-updater and updater-repo and builds |
| 2 | // master branches whenever a change is pushed to any of these | 2 | // master branches whenever a change is pushed to any of these |
| 3 | 3 | ||
| 4 | // define these for docker image creation | ||
| 5 | node { | ||
| 6 | // might cause some problems: | ||
| 7 | // https://stackoverflow.com/questions/44805076/setting-build-args-for-dockerfile-agent-using-a-jenkins-declarative-pipeline | ||
| 8 | JENKINS_UID = sh(returnStdout: true, script: 'id -u').trim() | ||
| 9 | JENKINS_GID = sh(returnStdout: true, script: 'id -g').trim() | ||
| 10 | } | ||
| 11 | |||
| 4 | pipeline { | 12 | pipeline { |
| 5 | agent none | 13 | agent any |
| 6 | environment { | 14 | environment { |
| 7 | TEST_AKTUALIZR_REMOTE = 'aktualizr' | 15 | TEST_AKTUALIZR_REMOTE = 'aktualizr' |
| 8 | TEST_AKTUALIZR_DIR = 'aktualizr' | 16 | TEST_AKTUALIZR_DIR = 'aktualizr' |
| @@ -11,8 +19,8 @@ pipeline { | |||
| 11 | } | 19 | } |
| 12 | stages { | 20 | stages { |
| 13 | stage('checkout') { | 21 | stage('checkout') { |
| 14 | agent any | ||
| 15 | steps { | 22 | steps { |
| 23 | |||
| 16 | checkout([$class: 'GitSCM', | 24 | checkout([$class: 'GitSCM', |
| 17 | userRemoteConfigs: [ | 25 | userRemoteConfigs: [ |
| 18 | [url: 'https://github.com/advancedtelematic/aktualizr', name: 'aktualizr'] | 26 | [url: 'https://github.com/advancedtelematic/aktualizr', name: 'aktualizr'] |
| @@ -61,6 +69,8 @@ pipeline { | |||
| 61 | dockerfile { | 69 | dockerfile { |
| 62 | filename 'scripts/ci/Dockerfile.bitbake' | 70 | filename 'scripts/ci/Dockerfile.bitbake' |
| 63 | args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common' | 71 | args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common' |
| 72 | additionalBuildArgs "--build-arg uid=${JENKINS_UID} --build-arg gid=${JENKINS_GID}" | ||
| 73 | reuseNode true | ||
| 64 | } | 74 | } |
| 65 | } | 75 | } |
| 66 | environment { | 76 | environment { |
