Merge "'Update validate autorelease projects for fluorine"
[releng/builder.git] / check_robot.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 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 # Ensures that we are only ever using one robot system
12 #
13 # Due to the way the Jenkins OpenStack Cloud plugin works we can only limit
14 # max parallel robot systems by the VM. So having multiple VM types makes it
15 # very difficult for us to properly limit the amount of parallel robot runs.
16
17 robots=$(find . -name "*.yaml" -print0 \
18     | xargs -0 grep centos7-robot | awk '{print $NF}' \
19     | sort | uniq | wc -l)
20
21 if [ "$robots" -gt 1 ]; then
22     echo "ERROR: More than one robot system type definition detected."
23     echo "Please ensure that ALL templates use the same robot nodes."
24     echo "Infra does not support more than 1 robot node type in use."
25     exit 1
26 fi