-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
89 lines (88 loc) · 2.78 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
properties([gitLabConnection('GitLab')])
pipeline {
agent {
label 'agent'
}
environment {
UID = sh(script: 'id -u', returnStdout: true).trim()
GID = sh(script: 'id -g', returnStdout: true).trim()
TMPDIR = '/tmp'
}
options {
gitlabBuilds(builds: [
"Build (amd64)",
"Build (arm64v8)",
"Analyse: Lint (amd64)",
"Analyse: Lint (arm64v8)",
"Test: utests (amd64)",
"Test: utests (arm64v8)",
])
buildDiscarder(logRotator(numToKeepStr: '4'))
disableConcurrentBuilds()
}
stages {
stage ('Setup') {
steps {
sh '''#!/bin/bash -xe
git clean -xdff
'''
}
}
stage ('Build') {
matrix {
axes {
axis {
name 'ARCH'
values 'amd64', 'arm64v8'
}
}
agent {
dockerfile {
dir 'ci'
reuseNode true
additionalBuildArgs "--build-arg REPO=${ARCH} --build-arg USER=jenkins \
--build-arg UID=${UID} --build-arg GID=${GID}"
args "--privileged \
-v /home/jenkins/.ssh:/home/jenkins/.ssh \
-e HOME=/home/jenkins"
}
}
stages {
stage('Build') {
steps {
gitlabCommitStatus("${STAGE_NAME} (${ARCH})") {
sh '''#!/bin/bash -xe
ci/build.sh
ci/build.sh debug
'''
}
}
}
stage ('Analyse: Lint') {
steps {
gitlabCommitStatus("${STAGE_NAME} (${ARCH})") {
sh '''#!/bin/bash -xe
ci/run-lint.sh
'''
}
}
}
stage ('Test: utests') {
steps {
gitlabCommitStatus("${STAGE_NAME} (${ARCH})") {
sh '''#!/bin/bash -xe
ci/run-utests.sh
'''
}
}
}
}
}
}
}
post {
always {
archiveArtifacts 'result/**'
}
}
}