forked from openedx-unsupported/edx-app-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
83 lines (77 loc) · 3.21 KB
/
Jenkinsfile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env groovy
pipeline {
agent {
label 'android-worker'
}
environment {
PIPELINE_JOBS_NAME = 'edx-app-android-pipeline'
ANDROID_HOME = '/opt/android-sdk-linux'
APK_PATH = 'OpenEdXMobile/build/outputs/apk/prod/debuggable'
CONFIG_REPO_NAME = 'edx-mobile-config'
TEST_PROJECT_REPO_NAME = 'edx-app-test'
AUT_NAME = 'edx-debuggable-3.1.0.apk'
USER_NAME = credentials('AUTOMATION_USERNAME')
USER_PASSWORD = credentials('AUTOMATION_PASSWORD')
}
stages {
stage('checkingout configs') {
steps {
dir("$CONFIG_REPO_NAME"){
sshagent(credentials: ['jenkins-worker', 'jenkins-worker-pem'], ignoreMissing: true) {
checkout changelog: false, poll: false, scm: [
$class: 'GitSCM',
branches:
// Using specific branch to avoid Firebase config limitations
//[[name: '*/master']],
[[name: 'naveed/automation_configs']],
doGenerateSubmoduleConfigurations: false,
extensions:
[[$class: 'CloneOption', honorRefspec: true,
noTags: true, shallow: true]],
submoduleCfg: [],
userRemoteConfigs:
[[credentialsId: 'jenkins-worker',
refspec: '+refs/heads/*:refs/remotes/origin/*',
url: "[email protected]:edx/${CONFIG_REPO_NAME}.git"]]
]
}
}
}
}
stage('compiling edx-app-android') {
steps {
writeFile file: './OpenEdXMobile/edx.properties', text: 'edx.dir = \'../edx-mobile-config/prod/\''
sh 'bash ./resources/compile_android.sh'
}
}
stage('valdiate compiled app') {
steps {
sh 'bash ./resources/validate_builds.sh'
archiveArtifacts artifacts: "$APK_PATH/*.apk", onlyIfSuccessful: true //
}
}
stage('checkout test project repo') {
steps {
dir("$TEST_PROJECT_REPO_NAME"){
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/edx/edx-app-test.git']]])
}
}
}
stage('prepare package for aws device farm') {
steps {
sh 'bash ./resources/prepare_aws_package.sh'
archiveArtifacts artifacts: "test_bundle.zip", onlyIfSuccessful: true
}
}
stage('setup virtual env and trigger run on aws device farm') {
steps {
sh 'bash ./resources/setup_virtual_env.sh'
}
}
}
post {
always {
archiveArtifacts artifacts: '*/Test spec output.txt, */Video.mp4, */Customer Artifacts.zip', onlyIfSuccessful: true
}
}
}