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