@@ -31,11 +31,20 @@ pipeline {
31
31
}
32
32
33
33
agent {
34
- docker {
35
- image ' catrobat/catrobat-android:stable'
36
- args ' --device /dev/kvm:/dev/kvm -v /var/local/container_shared/gradle_cache/$EXECUTOR_NUMBER:/home/user/.gradle -m=6.5G'
37
- label ' LimitedEmulator'
38
- alwaysPull true
34
+ dockerfile {
35
+ filename ' Dockerfile.jenkins'
36
+ // 'docker build' would normally copy the whole build-dir to the container, changing the
37
+ // docker build directory avoids that overhead
38
+ dir ' docker'
39
+ // Pass the uid and the gid of the current user (jenkins-user) to the Dockerfile, so a
40
+ // corresponding user can be added. This is needed to provide the jenkins user inside
41
+ // the container for the ssh-agent to work.
42
+ // Another way would be to simply map the passwd file, but would spoil additional information
43
+ // Also hand in the group id of kvm to allow using /dev/kvm.
44
+ additionalBuildArgs ' --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg KVM_GROUP_ID=$(getent group kvm | cut -d: -f3)'
45
+ // Ensure that each executor has its own gradle cache to not affect other builds
46
+ // that run concurrently.
47
+ args ' --device /dev/kvm:/dev/kvm'
39
48
}
40
49
}
41
50
@@ -118,14 +127,13 @@ pipeline {
118
127
steps {
119
128
sh " echo no | avdmanager create avd --force --name android28 --package 'system-images;android-28;default;x86_64'"
120
129
sh " /home/user/android/sdk/emulator/emulator -no-window -no-boot-anim -noaudio -avd android28 > /dev/null 2>&1 &"
121
- sh ' /home/user/android/sdk/platform-tools/adb logcat -d > Paintroid/logcat.txt'
122
- sh ' cat /Paintroid/logcat.txt'
123
- archiveArtifacts ' Paintroid/logcat.txt'
124
- sh ' ./gradlew -PenableCoverage -Pjenkins -Pemulator=android28 -Pci createDebugCoverageReport -i'
130
+ // sh './gradlew -PenableCoverage -Pjenkins -Pemulator=android28 -Pci createDebugCoverageReport -i'
125
131
}
126
132
post {
127
133
always {
128
- sh ' /home/user/android/sdk/platform-tools/adb logcat -d > Paintroid/logcat.txt'
134
+ sh ' pwd'
135
+ sh ' ls -la'
136
+ sh ' /home/user/android/sdk/platform-tools/adb logcat -d > logcat.txt'
129
137
sh ' ./gradlew stopEmulator'
130
138
junitAndCoverage " $reports /coverage/debug/report.xml" , ' device' , javaSrc
131
139
archiveArtifacts ' Paintroid/logcat.txt'
0 commit comments