add ccsdk-sli-northbound
[infra/cicd.git] / jjb / cloud-infra / common / cloud-infra-cleanup-stacks.yaml
1 ---
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2020 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19
20 # A project to remove any CI stacks that are left overnight. The domain
21 # reason they would be left is for troubleshooting where the
22 # DELETE_STACK option was set to false
23 - project:
24     name: 'cloud-infra-cleanup-stacks'
25
26     project: 'cloud-infra-cleanup-stacks'
27
28     cloud:
29       - city:
30           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
31
32     jobs:
33       - 'cloud-infra-cleanup-stack-{cloud}'
34
35 - job-template:
36     name: 'cloud-infra-cleanup-stack-{cloud}'
37
38     disabled: '{obj:disabled}'
39
40     concurrent: false
41
42     parameters:
43       - label:
44           name: SLAVE_LABEL
45           default: "engine-package-ubuntu1804-fra"
46           description: "tieing to specific cloud-infra slave so it doesn't end up on another openstack slave randomly"
47       - string:
48           name: STACK_START_STR
49           default: "nordix-cicd-"
50           description: "A pattern of stack names to search for"
51       - string:
52           name: TIMETOLIVE
53           default: "180"
54           description: "Don't delete stacks created in this timeframe of minutes"
55     properties:
56       - logrotate
57
58     triggers:
59       - timed: "@midnight"
60
61     wrappers:
62       - build-timeout:
63           timeout: 180
64       - credentials-binding:
65           - file:
66               credential-id: '{openrc-credentials-file}'
67               variable: OPENRC_FILE
68       - mask-passwords
69       - openstack:
70           single-use: True
71
72     builders:
73       - 'wait-pkg-mgr-macro'
74       - 'cloud-infra-cleanup-stack-macro'