-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile
More file actions
62 lines (62 loc) · 2.14 KB
/
Copy pathJenkinsfile
File metadata and controls
62 lines (62 loc) · 2.14 KB
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
pipeline {
agent any
triggers {
gerrit customUrl: '',
gerritProjects: [
[branches: [[compareType: 'PLAIN', pattern: 'master']],
compareType: 'PLAIN',
disableStrictForbiddenFileVerification: false,
pattern: 'dhtnet']],
triggerOnEvents: [
commentAddedContains('!build'),
patchsetCreated(excludeDrafts: true, excludeNoCodeChange: true)]
}
options {
ansiColor('xterm')
}
parameters {
string(name: 'GERRIT_REFSPEC',
defaultValue: 'refs/heads/dhtnet',
description: 'The Gerrit refspec to fetch.')
}
stages {
stage('SCM Checkout') {
steps {
checkout changelog: true, poll: false,
scm: [$class: 'GitSCM',
branches: [[name: 'FETCH_HEAD']],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'CloneOption', noTags: true, reference: '', shallow: true],
[$class: 'WipeWorkspace']],
submoduleCfg: [],
userRemoteConfigs: [[refspec: '${GERRIT_REFSPEC}', url: 'https://${JAMI_GERRIT_URL}/dhtnet']]]
}
}
stage('Build') {
steps {
script {
docker.build("dhtnet:${env.BUILD_ID}", "--target build .")
}
}
}
stage('Test') {
steps {
script {
docker.build("dhtnet-test:${env.BUILD_ID}", "--target test .")
}
}
}
stage('Extract Results') {
steps {
sh """
container_id=\$(docker create dhtnet-test:${env.BUILD_ID})
docker cp \$container_id:/result.summary result.summary
docker cp \$container_id:/coverage coverage
docker rm -v \$container_id
cat result.summary
"""
}
}
}
}