blob: 8ee08d3653d26e82ef910353f0c392924826c4ac [file] [log] [blame]
Sébastien Blin55be5da2024-02-12 11:29:54 -05001pipeline {
2 agent any
3 triggers {
4 gerrit customUrl: '',
5 gerritProjects: [
6 [branches: [[compareType: 'PLAIN', pattern: 'master']],
7 compareType: 'PLAIN',
8 disableStrictForbiddenFileVerification: false,
9 pattern: 'master']],
10 triggerOnEvents: [
11 commentAddedContains('!build'),
12 patchsetCreated(excludeDrafts: true, excludeNoCodeChange: true)]
13 }
14 options {
15 ansiColor('xterm')
16 }
17 parameters {
18 string(name: 'GERRIT_REFSPEC',
19 defaultValue: 'refs/heads/master',
20 description: 'The Gerrit refspec to fetch.')
21 }
22 stages {
23 stage('SCM Checkout') {
24 steps {
25 checkout changelog: true, poll: false,
26 scm: [$class: 'GitSCM',
27 branches: [[name: 'FETCH_HEAD']],
28 doGenerateSubmoduleConfigurations: false,
29 extensions: [
30 [$class: 'CloneOption', noTags: true, reference: '', shallow: true],
31 [$class: 'WipeWorkspace']],
32 submoduleCfg: [],
33 userRemoteConfigs: [[refspec: '${GERRIT_REFSPEC}', url: 'https://${JAMI_GERRIT_URL}/dhtnet']]]
34 }
35 }
36 stage('Build') {
37 steps {
38 script {
39 docker.build("dhtnet:${env.BUILD_ID}", "--target test .")
40 }
41 }
42 }
43 stage('Show result') {
44 steps {
45 sh """
46 id=\$(docker create dhtnet:${env.BUILD_ID})
47 docker cp \$id:/result.summary result.summary
48 cat result.summary
Sébastien Bline853f502024-02-12 15:56:39 -050049 docker cp \$id:/coverage coverage
Sébastien Blin55be5da2024-02-12 11:29:54 -050050 docker rm -v \$id
51 """
52 }
53 }
54 stage('Upload') {
55 steps {
56 sshagent(['5825b39b-dfc6-435f-918e-12acc1f56221']) {
57 sh("rsync -a coverage ${env.SSH_HOST_DL_RING_CX}:/srv/repository/ring/docs/dhtnet/")
58 }
59 }
60 }
61 }
62}