Skip to content

Commit

Permalink
Merge pull request #4615 from goschale/DEVOPS-694
Browse files Browse the repository at this point in the history
DEVOPS-694 fixed DockerParameters
  • Loading branch information
juliajulie95 authored Aug 25, 2022
2 parents 47e52a5 + 9cc3c6f commit 8c9a22b
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
#!groovy

class DockerParameters {
def fileName = 'Dockerfile.jenkins'

// 'docker build' would normally copy the whole build-dir to the container, changing the
// docker build directory avoids that overhead
def dir = 'docker'

// Pass the uid and the gid of the current user (jenkins-user) to the Dockerfile, so a
// corresponding user can be added. This is needed to provide the jenkins user inside
// the container for the ssh-agent to work.
// Another way would be to simply map the passwd file, but would spoil additional information
// Also hand in the group id of kvm to allow using /dev/kvm.
def buildArgs = '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg KVM_GROUP_ID=$(getent group kvm | cut -d: -f3)'

def args = '--device /dev/kvm:/dev/kvm -v /var/local/container_shared/gradle_cache/$EXECUTOR_NUMBER:/home/user/.gradle -v /var/local/container_shared/huawei:/home/user/huawei -m=14G'
def args = '--device /dev/kvm:/dev/kvm -v /var/local/container_shared/gradle_cache/$EXECUTOR_NUMBER:/home/user/.gradle -v /var/local/container_shared/huawei:/home/user/huawei -m=8G'
def label = 'LimitedEmulator'
def image = 'catrobat/catrobat-android:stable'
}

def d = new DockerParameters()
Expand Down Expand Up @@ -117,16 +108,16 @@ pipeline {
cron(env.BRANCH_NAME == 'develop' ? '@midnight' : '')
issueCommentTrigger('.*test this please.*')
}

stages {
stage('All') {
parallel {
stage('1') {
agent {
docker {
image 'catrobat/catrobat-android:stable'
args '--device /dev/kvm:/dev/kvm -v /var/local/container_shared/gradle_cache/$EXECUTOR_NUMBER:/home/user/.gradle -m=6.5G'
label 'LimitedEmulator'
image d.image
args d.args
label d.label
alwaysPull true
}
}
Expand Down Expand Up @@ -296,9 +287,9 @@ pipeline {
stage('2') {
agent {
docker {
image 'catrobat/catrobat-android:stable'
args '--device /dev/kvm:/dev/kvm -v /var/local/container_shared/gradle_cache/$EXECUTOR_NUMBER:/home/user/.gradle -m=6.5G'
label 'LimitedEmulator'
image d.image
args d.args
label d.label
alwaysPull true
}
}
Expand Down

0 comments on commit 8c9a22b

Please sign in to comment.