2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2019 The Linux Foundation and others.
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 "---> check-info-votes.sh"
14 ref=$(echo "$GERRIT_REFSPEC" | awk -F"/" '{ print $4 }')
18 if [[ $NODE_NAME =~ "lf-build" ]]; then
22 if [ -d "/opt/pyenv" ]; then
23 echo "---> Setting up pyenv"
24 export PYENV_ROOT="/opt/pyenv"
25 export PATH="$PYENV_ROOT/bin:$PATH"
29 export PYENV_VERSION="3.6.4"
32 $pip install --user niet
33 $pip install --user lftools
34 $pip install --user lftools[nexus]
35 $pip install --user jsonschema
37 change="$(echo "$GERRIT_CHANGE_URL" | awk -F"/" '{print $NF}')"
38 echo "Checking votes:"
39 lftools infofile check-votes INFO.yaml "$GERRIT_URL" "$ref" > gerrit_comment.txt
42 if [[ "$exit_status" -ne 0 ]]; then
43 echo "Vote not yet complete"
44 cat gerrit_comment.txt
47 echo "Vote completed submitting review"
48 ssh -p "$GERRIT_PORT" "$USER"@"$GERRIT_HOST" gerrit review "$change" --submit