forked from SirOibaf/hops-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
93 lines (93 loc) · 2.55 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
pipeline {
agent {
node {
label 'community_tester'
}
}
stages {
stage('prepareRepos') {
agent {
node {
label 'community_tester'
}
}
steps {
sh '${WORKSPACE}/scripts/prepare_repos.sh'
}
}
stage('checkLicenses') {
agent {
node {
label 'community_tester'
}
}
steps {
sh '${WORKSPACE}/scripts/check_licenses.sh'
}
}
stage('build') {
parallel {
stage('BuildUbuntu') {
agent {
node {
label 'community_tester'
}
}
steps {
sh '${WORKSPACE}/scripts/run_test.sh ubuntu'
sh 'mkdir out-$BUILD_NUMBER'
sh 'cd karamel-chef && vagrant scp ubuntu-$BUILD_NUMBER:/home/vagrant/test_report/* ../out-$BUILD_NUMBER'
sh 'cd karamel-chef && vagrant scp ubuntu-$BUILD_NUMBER:/home/vagrant/test_report/ut/* ../out-$BUILD_NUMBER/ut'
}
post {
always {
stash(name: "ubuntu-${env.BUILD_NUMBER}", includes: "out-${env.BUILD_NUMBER}/*.xml")
junit "out-${env.BUILD_NUMBER}/ut/*.xml"
sh 'rm -rf out-$BUILD_NUMBER'
sh '${WORKSPACE}/scripts/shutdown.sh ubuntu-$BUILD_NUMBER'
}
}
}
stage('BuildCentos') {
agent {
node {
label 'community_tester'
}
}
steps {
sh '${WORKSPACE}/scripts/run_test.sh centos'
sh 'mkdir out-$BUILD_NUMBER'
sh 'cd karamel-chef && vagrant scp centos-$BUILD_NUMBER.0:/home/vagrant/test_report/* ../out-$BUILD_NUMBER'
}
post {
always {
stash(name: "centos-${env.BUILD_NUMBER}", includes: "out-${env.BUILD_NUMBER}/*.xml")
sh 'rm -fr out-$BUILD_NUMBER'
sh '${WORKSPACE}/scripts/shutdown.sh centos-$BUILD_NUMBER.0'
sh '${WORKSPACE}/scripts/shutdown.sh centos-$BUILD_NUMBER.1'
sh '${WORKSPACE}/scripts/shutdown.sh centos-$BUILD_NUMBER.2'
}
}
}
}
}
stage('cleanup') {
agent {
node {
label 'community_tester'
}
}
steps {
sh '${WORKSPACE}/scripts/clean_branches.sh'
}
}
}
post {
always {
unstash "ubuntu-${env.BUILD_NUMBER}"
unstash "centos-${env.BUILD_NUMBER}"
junit "out-${env.BUILD_NUMBER}/*.xml,out-${env.BUILD_NUMBER}/centos.xml"
sh 'rm -r out-$BUILD_NUMBER'
}
}
}