blob: e6074c1cb5e46ec6d0ee8dfbcab8e3a528a1eee5 [file] [log] [blame]
Kailash Khalasif005fcb2018-10-02 12:52:03 -07001/* seba-in-a-box build+test */
2
3pipeline {
4
5 /* no label, executor is determined by JJB */
6 agent {
7 label "${params.executorNode}"
8 }
9
Kailash Khalasif005fcb2018-10-02 12:52:03 -070010 stages {
11
12 stage ("Clean workspace") {
13 steps {
14 sh 'rm -rf *'
15 }
16 }
17
18 stage ('Checkout Automation-Tools Repo') {
19 steps {
20 sh '''
21 pushd $WORKSPACE
22 git clone https://gerrit.opencord.org/automation-tools
23 popd
24 '''
25 }
26 }
27
28 stage ('Reset Kubeadm') {
29 steps {
30 sh """
31 pushd $WORKSPACE/automation-tools/seba-in-a-box
32 make reset-kubeadm
33 popd
34 """
35 }
36 }
37
38 stage ('Install SEBA') {
39 steps {
40 sh """
41 pushd $WORKSPACE/automation-tools/seba-in-a-box
42 make -j2
43 popd
44 """
45 }
46 }
47
48 stage ('Run E2E Tests') {
49 steps {
50 sh """
51 pushd $WORKSPACE/automation-tools/seba-in-a-box
Kailash Khalasi2a1e24b2018-10-02 14:15:59 -070052 make run-tests || true
Kailash Khalasif005fcb2018-10-02 12:52:03 -070053 popd
54 """
55 }
56 }
57
58 stage('Publish') {
59 steps {
60 sh """
61 if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs
62 cp -r $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/WorkflowValidations/*ml ./RobotLogs
63 """
64 step([$class: 'RobotPublisher',
65 disableArchiveOutput: false,
66 logFileName: 'RobotLogs/log*.html',
67 otherFiles: '',
68 outputFileName: 'RobotLogs/output*.xml',
69 outputPath: '.',
70 passThreshold: 100,
71 reportFileName: 'RobotLogs/report*.html',
72 unstableThreshold: 0]);
73 }
74 }
75
76 }
77
78 post {
79 always {
80 sh '''
Kailash Khalasi2a1e24b2018-10-02 14:15:59 -070081 sudo cp /var/log/containers/*.log $WORKSPACE/
82 sudo chown cord:cord $WORKSPACE/*log
Kailash Khalasif005fcb2018-10-02 12:52:03 -070083 '''
Kailash Khalasi2a1e24b2018-10-02 14:15:59 -070084 archiveArtifacts artifacts: '*.log'
Kailash Khalasif005fcb2018-10-02 12:52:03 -070085 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "andy@opennetworking.org, kailash@opennetworking.org", sendToIndividuals: false])
86 }
Kailash Khalasibb2042e2018-10-04 09:41:49 -070087 failure {
88 sh '''
89 curl -X GET -u karaf:karaf http://127.0.0.1:30120/onos/v1/devices
90 curl -X GET -u karaf:karaf http://127.0.0.1:30120/onos/v1/devices/of:0000000000000001/ports
91 curl -X GET http://127.0.0.1:30125/api/v1/devices
92 curl -X GET http://127.0.0.1:30125/api/v1/logical_devices
93 '''
94 }
Kailash Khalasif005fcb2018-10-02 12:52:03 -070095 }
96}