-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile
59 lines (57 loc) · 1.98 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
pipeline {
agent {
label 'main'
}
options {
timeout(time: 26, unit: 'MINUTES')
}
stages {
stage('Build CI image') {
steps {
script {
docker.build("storj-ci", "--pull https://github.com/storj/ci.git#main:android")
}
}
}
stage('Verification') {
parallel {
stage('Testsuite') {
agent {
docker {
label 'main'
// Run everything on the same node so we only have to build the docker image once.
// Alternatively we can push the image to a registry.
reuseNode true
image 'storj-ci'
args '-u root:root --cap-add SYS_PTRACE -v "/tmp/gomod":/go/pkg/mod'
}
}
environment {
ANDROID_HOME = '/opt/android-sdk-linux'
STORJ_SIM_POSTGRES = 'postgres://postgres@localhost/teststorj?sslmode=disable'
}
steps {
sh 'mkdir -p .build'
sh 'service postgresql start'
sh 'psql -U postgres -c \'create database teststorj;\''
sh './scripts/test-android.sh'
}
post {
always {
sh "chmod -R 777 ." // ensure Jenkins agent can delete the working directory
junit 'uplink-android/build/outputs/androidTest-results/connected/TEST-android_libuplink_test(AVD) - 7.0-uplink-android-.xml'
}
}
}
}
}
}
post {
always {
node(null) {
cleanWs()
deleteDir()
}
}
}
}