This repository has been archived by the owner on Oct 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
68 lines (68 loc) · 2.64 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
def gradleParams = "-Psnapshot=false -Pbranch=${env.BRANCH_NAME}"
pipeline{
agent any
stages {
stage('Build lib') {
agent any
steps {
sh "git fetch https://github.com/bvolkmer/PaiMan.git +refs/heads/master:refs/remotes/origin/master"
sh "./gradlew libpaiman:build $gradleParams"
}
}
stage('Test lib') {
agent any
steps {
sh "./gradlew libpaiman:check $gradleParams"
}
}
stage('Build client') {
agent {label "android-sdk"}
steps {
parallel javafx: {
sh "./gradlew app:distZip $gradleParams"
},
android: {
sh "./gradlew android:assemble $gradleParams"
}
}
}
stage('Test clients') {
agent {label "android-emulator"}
steps {
parallel javafx: {
sh "./gradlew app:check $gradleParams"
},
android: {
echo "Start emulators"
sh '$ANDROID_HOME/emulator/emulator @jenkins-paiman-19 -no-audio -no-window -wipe-data &'
sh '$ANDROID_HOME/emulator/emulator @jenkins-paiman-21 -no-audio -no-window -wipe-data &'
sh '$ANDROID_HOME/emulator/emulator @jenkins-paiman-24 -no-audio -no-window -wipe-data &'
echo "Wait for emulators"
waitUntil {
script {
try {
sh 'if [ `$ANDROID_HOME/platform-tools/adb devices | grep emulator | cut -f1 | wc -l` -ne 3 ]; then exit 1; fi'
return true
} catch (exception) {
return false
}
}
}
sh './android-wait-for-emulator.sh `$ANDROID_HOME/platform-tools/adb devices | grep emulator | cut -f1 `'
echo "RunCheck"
sh "./gradlew android:connectedCheck $gradleParams"
}
}
}
stage ("Deploy") {
agent { label "deploy" }
steps {
sh "mkdir -p archive/"
sh "rm -f archive/*"
sh "git fetch https://github.com/bvolkmer/PaiMan.git +refs/heads/master:refs/remotes/origin/master"
sh "./gradlew copyArtifacts $gradleParams"
sh "cp -f archive/* /srv/http/develop/downloads/PaiMan"
}
}
}
}