Ray Milkey | cf3e368 | 2017-03-14 16:56:18 -0700 | [diff] [blame] | 1 | #!groovy |
| 2 | |
Ray Milkey | 19793a3 | 2017-03-13 17:17:12 -0700 | [diff] [blame] | 3 | pipeline { |
Ray Milkey | d7200da | 2017-03-29 16:25:13 -0700 | [diff] [blame] | 4 | |
Ray Milkey | 19793a3 | 2017-03-13 17:17:12 -0700 | [diff] [blame] | 5 | agent any |
Ray Milkey | 1304e21 | 2017-03-14 10:12:01 -0700 | [diff] [blame] | 6 | |
Ray Milkey | 19793a3 | 2017-03-13 17:17:12 -0700 | [diff] [blame] | 7 | stages { |
Ray Milkey | d7200da | 2017-03-29 16:25:13 -0700 | [diff] [blame] | 8 | stage('pull') { |
| 9 | steps { |
| 10 | sh 'which warden-client && sum `which warden-client`' |
| 11 | sh 'warden-client list' |
| 12 | git url: 'https://gerrit.onosproject.org/onos' |
| 13 | sh 'warden-client --reqId CI-${BUILD_NUMBER} --timeout 5 --duration 10 --nodes 1 reserve' |
| 14 | } |
| 15 | } |
| 16 | |
Ray Milkey | 19793a3 | 2017-03-13 17:17:12 -0700 | [diff] [blame] | 17 | stage('build') { |
| 18 | steps { |
Ray Milkey | 52e7d6e | 2017-03-14 10:42:38 -0700 | [diff] [blame] | 19 | sh '''#!/bin/bash -l |
Ray Milkey | d7200da | 2017-03-29 16:25:13 -0700 | [diff] [blame] | 20 | ONOS_ROOT=`pwd` |
| 21 | source tools/build/envDefaults |
| 22 | onos-buck build onos |
Ray Milkey | 52e7d6e | 2017-03-14 10:42:38 -0700 | [diff] [blame] | 23 | ''' |
Ray Milkey | 19793a3 | 2017-03-13 17:17:12 -0700 | [diff] [blame] | 24 | } |
| 25 | } |
Ray Milkey | 7c28369 | 2017-03-14 12:42:42 -0700 | [diff] [blame] | 26 | |
Ray Milkey | d7200da | 2017-03-29 16:25:13 -0700 | [diff] [blame] | 27 | stage('test') { |
Ray Milkey | 7c28369 | 2017-03-14 12:42:42 -0700 | [diff] [blame] | 28 | steps { |
Ray Milkey | d7200da | 2017-03-29 16:25:13 -0700 | [diff] [blame] | 29 | parallel ( |
| 30 | "unit-tests": { |
| 31 | sh '''#!/bin/bash -l |
| 32 | ONOS_ROOT=`pwd` |
| 33 | source tools/build/envDefaults |
| 34 | onos-buck test |
| 35 | ''' |
| 36 | }, |
| 37 | "javadocs": { |
| 38 | sh '''#!/bin/bash -l |
| 39 | ONOS_ROOT=`pwd` |
| 40 | source tools/build/envDefaults |
| 41 | onos-buck build //docs:external //docs:internal --show-output |
| 42 | ''' |
| 43 | }, |
| 44 | "docker-image": { |
| 45 | sh '''#!/bin/bash -l |
| 46 | ONOS_ROOT=`pwd` |
| 47 | source tools/build/envDefaults |
| 48 | docker build -t onosproject/onos-test-docker . |
| 49 | ''' |
| 50 | }, |
| 51 | "stc": { |
| 52 | timeout(10) { |
| 53 | sh '''#!/bin/bash -l |
| 54 | export stcColor=false |
| 55 | ONOS_ROOT=`pwd` |
| 56 | source tools/build/envDefaults |
| 57 | onos-package-test |
| 58 | echo "Waiting for cell..." |
| 59 | warden-client --reqId CI-${BUILD_NUMBER} status > cell.txt |
| 60 | source cell.txt |
| 61 | rm -f cell.txt |
| 62 | proxy-stc |
| 63 | ''' |
| 64 | } |
| 65 | } |
| 66 | ) |
Ray Milkey | cf3e368 | 2017-03-14 16:56:18 -0700 | [diff] [blame] | 67 | } |
| 68 | } |
Ray Milkey | 6563971 | 2017-03-14 12:28:21 -0700 | [diff] [blame] | 69 | } |
| 70 | |
Ray Milkey | d7200da | 2017-03-29 16:25:13 -0700 | [diff] [blame] | 71 | post { |
| 72 | always { |
| 73 | sh '''#!/bin/bash -l |
| 74 | warden-client --reqId CI-${BUILD_NUMBER} return |
| 75 | ''' |
| 76 | } |
| 77 | } |
Ray Milkey | 19793a3 | 2017-03-13 17:17:12 -0700 | [diff] [blame] | 78 | } |
Ray Milkey | d7200da | 2017-03-29 16:25:13 -0700 | [diff] [blame] | 79 | |