25cf88c70f2c33b5b63404719e81d898b60344c6
[releng/builder.git] / jjb / odl-openstack-cleanup-stale-nodes.sh
1 #!/bin/bash -l
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2017 - 2018 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> Cleanup stale nodes"
12
13 # Todo: As a safe check we could obtain the list of active jobs from Jenkins and
14 # compute the checksum from $JOB_NAME to check if any active nodes exist and
15 # skip deleting those nodes. This step may not be required since there is already
16 # 24H timeout in place for all jobs therefore all jobs are expected to complete
17 # within the timeout.
18
19 lftools openstack --os-cloud vex server list --days=1
20 lftools openstack --os-cloud vex server cleanup --days=1