Merge "GIT Tagging: Vswitchperf."
[releng.git] / jjb / releng / opnfv-utils.yaml
1 ---
2 - project:
3
4     name: opnfv-utils
5
6     jobs:
7       - 'prune-docker-images'
8       - 'check-status-of-slaves'
9       - 'ansible-build-server'
10       - 'generate-artifacts-index-pages'
11
12 ########################
13 # job templates
14 ########################
15 - job-template:
16     name: 'prune-docker-images'
17
18     disabled: false
19
20     concurrent: true
21
22     parameters:
23       - node:
24           name: SLAVE_NAME
25           description: Slaves to prune docker images
26           default-slaves:
27             - arm-build3
28             - arm-build4
29             - arm-build5
30             - ericsson-build4
31             - lf-build2
32           allowed-multiselect: true
33           ignore-offline-nodes: true
34
35     builders:
36       - description-setter:
37           description: "Built on $NODE_NAME"
38       # yamllint disable rule:line-length
39       - shell: |
40           #!/bin/bash
41           sudo systemctl restart docker
42           (docker ps -q; docker ps -aq) | sort | uniq -u | xargs --no-run-if-empty docker rm
43           docker images -f dangling=true -q | xargs --no-run-if-empty docker rmi
44
45
46     # yamllint enable rule:line-length
47     triggers:
48       - timed: '@midnight'
49
50 - job-template:
51     name: 'check-status-of-slaves'
52
53     disabled: false
54     concurrent: true
55
56     parameters:
57       - node:
58           name: SLAVE_NAME
59           description: 'script lives on master node'
60           default-slaves:
61             - lf-build2
62           allowed-multiselect: false
63           ignore-offline-nodes: true
64       - project-parameter:
65           project: releng
66           branch: master
67
68     scm:
69       - git-scm
70
71     triggers:
72       - timed: '@midnight'
73
74     builders:
75       - shell: |
76           cd $WORKSPACE/utils/
77           bash slave-monitor-0.1.sh
78
79 - job-template:
80     name: 'ansible-build-server'
81
82     project-type: freestyle
83
84     disabled: false
85     concurrent: true
86
87     parameters:
88       - node:
89           name: SLAVE_NAME
90           description: Build Servers
91           default-slaves:
92             - lf-build1
93             - lf-build2
94             - lf-build3
95             - ericsson-build4
96           allowed-multiselect: true
97           ignore-offline-nodes: true
98       - project-parameter:
99           project: releng
100           branch: master
101
102     scm:
103       - git-scm
104
105     triggers:
106       - timed: '@midnight'
107
108     builders:
109       - description-setter:
110           description: '$NODE_NAME'
111       - install-ansible
112       - run-ansible-build-server-playbook
113
114
115 - builder:
116     name: install-ansible
117     builders:
118       - shell: |
119           # Install ansible here
120           if [ -f /etc/centos-release ] \
121           || [ -f /etc/redhat-release ] \
122           || [ -f /etc/system-release ]; then
123           sudo yum -y install ansible
124           fi
125           if [ -f /etc/debian_version ] \
126           || grep -qi ubuntu /etc/lsb-release \
127           || grep -qi ubuntu /etc/os-release; then
128           sudo apt-get -y install ansible
129           fi
130
131
132 - builder:
133     name: run-ansible-build-server-playbook
134     builders:
135       - shell: |
136           # run playbook
137           sudo ansible-playbook -i \
138           $WORKSPACE/utils/build-server-ansible/inventory.ini \
139           $WORKSPACE/utils/build-server-ansible/main.yml
140
141
142 - job-template:
143     name: 'generate-artifacts-index-pages'
144
145     project-type: freestyle
146
147     disabled: false
148
149     concurrent: false
150
151     parameters:
152       - node:
153           name: SLAVE_NAME
154           description: Build Servers
155           default-slaves:
156             - lf-build2
157       - project-parameter:
158           project: releng
159           branch: master
160
161     scm:
162       - git-scm
163
164     triggers:
165       - timed: '@hourly'
166
167     builders:
168       - generate-artifact-html
169
170
171 - builder:
172     name: generate-artifact-html
173     builders:
174       - shell: |
175           cd $WORKSPACE/utils/
176           ./artifacts.opnfv.org.sh