X-Git-Url: https://gerrit.nordix.org/gitweb?a=blobdiff_plain;f=jjb%2Fcloud-infra%2Fcommon%2Fcloud-infra-cleanup-stacks.yaml;fp=jjb%2Fcloud-infra%2Fcommon%2Fcloud-infra-cleanup-stacks.yaml;h=91d5e6ec8dd39cc63f76cf72b8676a14b8405474;hb=b252d14afc71426da984abc144a26b630b0a2296;hp=0000000000000000000000000000000000000000;hpb=415d515459879913f4f0dd6e85c8843642548add;p=infra%2Fcicd.git diff --git a/jjb/cloud-infra/common/cloud-infra-cleanup-stacks.yaml b/jjb/cloud-infra/common/cloud-infra-cleanup-stacks.yaml new file mode 100644 index 00000000..91d5e6ec --- /dev/null +++ b/jjb/cloud-infra/common/cloud-infra-cleanup-stacks.yaml @@ -0,0 +1,73 @@ +--- +# ============LICENSE_START======================================================= +# Copyright (C) 2020 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +# A project to remove any CI stacks that are left overnight. The domain +# reason they would be left is for troubleshooting where the +# DELETE_STACK option was set to false +- project: + name: 'cloud-infra-cleanup-stacks' + + project: 'cloud-infra-cleanup-stacks' + + cloud: + - city: + openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd' + + jobs: + - 'cloud-infra-cleanup-stack-{cloud}' + +- job-template: + name: 'cloud-infra-cleanup-stack-{cloud}' + + disabled: '{obj:disabled}' + + concurrent: false + + parameters: + - label: + name: SLAVE_LABEL + default: "engine-package-ubuntu1804-fra" + description: "tieing to specific cloud-infra slave so it doesn't end up on another openstack slave randomly" + - string: + name: STACK_START_STR + default: "nordix-cicd-" + description: "A pattern of stack names to search for" + - string: + name: TIMETOLIVE + default: "180" + description: "Don't delete stacks created in this timeframe of minutes" + properties: + - logrotate + + triggers: + - timed: "@midnight" + + wrappers: + - build-timeout: + timeout: 180 + - credentials-binding: + - file: + credential-id: '{openrc-credentials-file}' + variable: OPENRC_FILE + - mask-passwords + - openstack: + single-use: True + + builders: + - 'cloud-infra-cleanup-stack-macro'