blob: 64b41db9a1940406e9667e2387764cd71bd2611b [file] [log] [blame]
Ray Milkeycf3e3682017-03-14 16:56:18 -07001#!groovy
2
Ray Milkey19793a32017-03-13 17:17:12 -07003pipeline {
Ray Milkeyd7200da2017-03-29 16:25:13 -07004
Ray Milkey19793a32017-03-13 17:17:12 -07005 agent any
Ray Milkey1304e212017-03-14 10:12:01 -07006
Ray Milkey19793a32017-03-13 17:17:12 -07007 stages {
Ray Milkeyd7200da2017-03-29 16:25:13 -07008 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 Milkey19793a32017-03-13 17:17:12 -070017 stage('build') {
18 steps {
Ray Milkey52e7d6e2017-03-14 10:42:38 -070019 sh '''#!/bin/bash -l
Ray Milkeyd7200da2017-03-29 16:25:13 -070020 ONOS_ROOT=`pwd`
21 source tools/build/envDefaults
22 onos-buck build onos
Ray Milkey52e7d6e2017-03-14 10:42:38 -070023 '''
Ray Milkey19793a32017-03-13 17:17:12 -070024 }
25 }
Ray Milkey7c283692017-03-14 12:42:42 -070026
Ray Milkeyd7200da2017-03-29 16:25:13 -070027 stage('test') {
Ray Milkey7c283692017-03-14 12:42:42 -070028 steps {
Ray Milkeyd7200da2017-03-29 16:25:13 -070029 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 Milkeycf3e3682017-03-14 16:56:18 -070067 }
68 }
Ray Milkey65639712017-03-14 12:28:21 -070069 }
70
Ray Milkeyd7200da2017-03-29 16:25:13 -070071 post {
72 always {
73 sh '''#!/bin/bash -l
74 warden-client --reqId CI-${BUILD_NUMBER} return
75 '''
76 }
77 }
Ray Milkey19793a32017-03-13 17:17:12 -070078}
Ray Milkeyd7200da2017-03-29 16:25:13 -070079