-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
38 lines (21 loc) · 1.02 KB
/
Jenkinsfile
File metadata and controls
38 lines (21 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
node{
stage 'Checkout'
checkout scm
sh "./gradlew clean"
stage 'Setup workspace'
sh "cp /opt/google-services.json app/"
stage 'Unit Test'
sh "./gradlew test"
stage "Sonar Analysis"
sh "./gradlew sonarqube"
stage 'Build'
echo "Building branch: ${env.BRANCH_NAME}"
sh "./gradlew assembleDebug"
sh "./gradlew assembleDebugAndroidTest"
stage 'Archive'
step([$class: 'ArtifactArchiver', artifacts: 'app/build/outputs/apk/**/*.apk', fingerprint: true])
step([$class: 'JUnitResultArchiver', testResults: 'app/build/test-results/**/TEST-*.xml'])
stage 'Cloud Test Lab'
sh "gcloud auth activate-service-account --key-file ${env.GCLOUD_AUTH_FILE}"
sh "gcloud beta test android run --project ${env.GCLOUD_NANODEGREE_CAPSTONE_PROJECT_ID} --app app/build/outputs/apk/debug/app-debug.apk --test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk --device-ids Nexus5,Nexus6,Nexus9 --os-version-ids 21,22,23 --locales en --orientations portrait,landscape"
}