#!/bin/bash
# SPDX-License-Identifier: EPL-1.0
##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
+# Copyright (c) 2017 - 2018 The Linux Foundation and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
+echo "---> Cleanup stale nodes"
# Todo: As a safe check we could obtain the list of active jobs from Jenkins and
# compute the checksum from $JOB_NAME to check if any active nodes exist and
# 24H timeout in place for all jobs therefore all jobs are expected to complete
# within the timeout.
-lftools openstack --os-cloud vex \
- server list --days=1
-lftools openstack --os-cloud vex \
- server cleanup --days=1
+# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
+source "/tmp/v/lftools/bin/activate"
+lftools openstack --os-cloud vex server list --days=1
+lftools openstack --os-cloud vex server cleanup --days=1
- gerrit-tox-verify
# OpenStack Related
- 'builder-delete-orphaned-nodes'
- - 'builder-delete-stale-nodes'
# Automation for docs and jobs
- 'builder-update-image-list'
- shell: !include-raw-escape: global-jjb/shell/lftools-install.sh
# Servers
- odl-openstack-cleanup-stale-stacks
+ - odl-openstack-cleanup-stale-nodes
# Images
- odl-openstack-check-image-protection
- odl-openstack-cleanup-old-images
email-prefix: '[releng]'
- lf-infra-publish
-
-- job-template:
- name: 'builder-delete-stale-nodes'
- project-type: freestyle
- node: centos7-builder-2c-1g
-
- properties:
- - opendaylight-infra-properties:
- build-days-to-keep: 7
-
- parameters:
- - opendaylight-infra-parameters:
- os-cloud: '{os-cloud}'
- project: '{project}'
- branch: '{branch}'
- refspec: 'refs/heads/{branch}'
- artifacts: '{archive-artifacts}'
-
- wrappers:
- - opendaylight-infra-wrappers:
- build-timeout: '{build-timeout}'
-
- triggers:
- # Attempt to clear up stacks every 30 mins in case we have orphaned stacks
- - timed: '0,30 * * * *'
-
- builders:
- - shell: !include-raw-escape:
- - global-jjb/shell/lftools-install.sh
- - opendaylight-infra-cleanup-stale-nodes.sh
-
- publishers:
- - email-notification:
- email-recipients: '{email-recipients}'
- email-prefix: '[releng]'
- - lf-infra-publish
-
- job-template:
name: 'builder-update-image-list'
project-type: freestyle