-
Notifications
You must be signed in to change notification settings - Fork 36
/
Jenkinsfile
106 lines (104 loc) · 4.24 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env groovy
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) milestone(buildNumber - 1)
milestone(buildNumber)
pipeline {
agent none
options {
timeout(time: 30, unit: 'MINUTES')
}
stages {
stage('Build and check') {
agent {
dockerfile {
filename 'Dockerfile.build'
args '-e PYTHONDONTWRITEBYTECODE=1'
label 'docker'
additionalBuildArgs '--build-arg=EXTRA_PACKAGES="libkustomer-dev"'
}
}
stages {
stage('Lint') {
steps {
echo 'Linting..'
sh 'flake8 -v --format=pylint swig/python/kopano/kopano > pylint.log || true'
recordIssues tool: pyLint(pattern: 'pylint.log'), qualityGates: [[threshold: 5000, type: 'TOTAL', unstable: true]]
}
}
stage('Build') {
steps {
echo 'Building..'
sh './bootstrap.sh'
sh './configure --enable-release --enable-pybind --enable-kcoidc --enable-kustomer TCMALLOC_CFLAGS=" " TCMALLOC_LIBS="-ltcmalloc_minimal" PYTHON="$(which python3)" PYTHON_CFLAGS="$(pkg-config python3 --cflags)" PYTHON_LIBS="$(pkg-config python3 --libs)"'
sh 'make -j $(nproc)'
recordIssues(tools: [gcc()])
}
}
stage('Check') {
steps {
echo 'Checking..'
sh 'make check'
}
}
stage('Test (short)') {
steps {
echo 'Testing ..'
sh 'make test-short PYTEST=pytest-3 || true'
junit testResults: 'php-ext/test-short.log'
junit testResults: 'swig/python/kopano/test-short.xml'
junit testResults: 'swig/python/test-short.xml'
}
}
}
post {
success {
stash includes: '**', excludes: '**/@/**', name: 'workspace'
}
cleanup {
cleanWs()
}
}
}
stage('Test Suite') {
agent {
label 'docker'
}
environment {
KUSTOMERD_PRESEED_LICENSE = credentials('KUSTOMERD_TEST_LICENSE')
}
stages {
stage('Verify') {
steps {
echo 'Checking build...'
unstash 'workspace'
}
}
stage('Run Test Suite') {
steps {
echo 'Testing..'
sh 'make -C test test-backend-kopano-ci-run EXTRA_LOCAL_ADMIN_USER=$(id -u) KUSTOMERD_PRESEED_LICENSE=${KUSTOMERD_PRESEED_LICENSE} TEST_LICENSE_AVAILABLE=$(test -z ${KUSTOMERD_PRESEED_LICENSE} || echo "1") DOCKERCOMPOSE_EXEC_ARGS="-T -u $(id -u) -e HOME=/workspace" || true'
junit testResults: 'php-ext/test.log'
junit testResults: 'libicalmapi/test.xml'
junit testResults: 'gateway/test.xml'
junit testResults: 'inetmapi/test.xml'
junit testResults: 'spooler/test.xml'
junit testResults: 'spooler/python/test.xml'
junit testResults: 'swig/python/test.xml'
junit testResults: 'swig/python/kopano/test.xml'
junit testResults: 'test/test-admin.log.xml'
junit testResults: 'test/test-ectools.log.xml'
}
}
}
post {
always {
sh 'make -C test test-backend-kopano-ci-logs DOCKERCOMPOSE_LOGS_ARGS="--timestamps --no-color" || true'
sh 'make -C test test-backend-kopano-ci-clean'
}
cleanup {
cleanWs()
}
}
}
}
}