blob: 9432f74ab574f434d69565b2a9caef39282601c2 [file] [log] [blame]
Darius87b55832021-12-15 16:12:38 -08001pipeline {
2 agent none
3 options {
4 timeout(time: 60, unit: 'MINUTES')
5 }
6
7 stages {
8 // start bess-upf on a host server
9 stage('Start BESS-UPF') {
10 agent {
11 label "${params.UPF_HOST_NODE}"
12 }
13 steps {
14 cleanWs()
15
16 // clone upf-epc repo
17 git branch: "${params.GIT_BRANCH}", credentialsId: 'github-onf-bot-ssh-key', url: "${params.GIT_URL}"
18
19 // overwrite config files with personalized config
20 sh 'cp ptf/config/docker_setup.sh .'
21 sh 'cp ptf/config/upf.json conf/'
22
23 // build and start bess-upf
24 sh './docker_setup.sh'
25 }
26 }
27 // run tests from a different server
28 stage('Run linerate tests') {
29 agent {
30 label "${params.BUILD_NODE}"
31 }
32 steps {
33 cleanWs()
34
35 // clone upf-epc
36 git branch: "${params.GIT_BRANCH}", credentialsId: 'github-onf-bot-ssh-key', url: "${params.GIT_URL}"
37
38 // generate python proto files and run tests
39 sh 'cd ptf && bash jenkins.sh'
40 }
41 }
42 }
43 post {
44 always {
45 // stop the upf on the host server
46 node("${params.UPF_HOST_NODE}") {
47 sh 'sleep 5'
48 sh 'docker container kill pause bess bess-web bess-pfcpiface bess-routectl || true'
49 }
50
51 // archive artifacts from the other server's test runs
52 node("${params.BUILD_NODE}") {
53 archiveArtifacts artifacts: 'ptf/log/ptf-logs/*', fingerprint: true
54 }
55 }
56 failure {
57 node("${params.BUILD_NODE}") {
58 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${params.MAINTAINERS}", sendToIndividuals: false])
59 }
60 }
61 }
62}