Kailash Khalasi | f005fcb | 2018-10-02 12:52:03 -0700 | [diff] [blame] | 1 | /* seba-in-a-box build+test */ |
| 2 | |
| 3 | pipeline { |
| 4 | |
| 5 | /* no label, executor is determined by JJB */ |
| 6 | agent { |
| 7 | label "${params.executorNode}" |
| 8 | } |
| 9 | |
| 10 | options { |
| 11 | timeout(20, MINUTES) |
| 12 | } |
| 13 | |
| 14 | stages { |
| 15 | |
| 16 | stage ("Clean workspace") { |
| 17 | steps { |
| 18 | sh 'rm -rf *' |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | stage ('Checkout Automation-Tools Repo') { |
| 23 | steps { |
| 24 | sh ''' |
| 25 | pushd $WORKSPACE |
| 26 | git clone https://gerrit.opencord.org/automation-tools |
| 27 | popd |
| 28 | ''' |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | stage ('Reset Kubeadm') { |
| 33 | steps { |
| 34 | sh """ |
| 35 | pushd $WORKSPACE/automation-tools/seba-in-a-box |
| 36 | make reset-kubeadm |
| 37 | popd |
| 38 | """ |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | stage ('Install SEBA') { |
| 43 | steps { |
| 44 | sh """ |
| 45 | pushd $WORKSPACE/automation-tools/seba-in-a-box |
| 46 | make -j2 |
| 47 | popd |
| 48 | """ |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | stage ('Run E2E Tests') { |
| 53 | steps { |
| 54 | sh """ |
| 55 | pushd $WORKSPACE/automation-tools/seba-in-a-box |
| 56 | make run-tests |
| 57 | popd |
| 58 | """ |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | stage('Publish') { |
| 63 | steps { |
| 64 | sh """ |
| 65 | if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs |
| 66 | cp -r $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/WorkflowValidations/*ml ./RobotLogs |
| 67 | """ |
| 68 | step([$class: 'RobotPublisher', |
| 69 | disableArchiveOutput: false, |
| 70 | logFileName: 'RobotLogs/log*.html', |
| 71 | otherFiles: '', |
| 72 | outputFileName: 'RobotLogs/output*.xml', |
| 73 | outputPath: '.', |
| 74 | passThreshold: 100, |
| 75 | reportFileName: 'RobotLogs/report*.html', |
| 76 | unstableThreshold: 0]); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | } |
| 81 | |
| 82 | post { |
| 83 | always { |
| 84 | sh ''' |
| 85 | |
| 86 | mkdir -p /tmp/logs |
| 87 | sudo cp /var/log/containers/*.log /tmp/logs |
| 88 | sudo chown cord /tmp/logs/*.log |
| 89 | |
| 90 | ''' |
| 91 | archiveArtifacts artifacts: '/tmp/logs/*.log' |
| 92 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "andy@opennetworking.org, kailash@opennetworking.org", sendToIndividuals: false]) |
| 93 | } |
| 94 | } |
| 95 | } |