devops: safety checks for buildbot scripts

This commit is contained in:
Andrey Lushnikov 2019-11-25 17:55:57 -08:00
parent 13282c9ac5
commit ab6e358c4d
4 changed files with 34 additions and 0 deletions

View File

@ -2,6 +2,11 @@
set -e
set +x
if [[ $(uname) != "Linux" ]]; then
echo "ERROR: this script is desgined to be run on Linux. Can't run on $(uname)"
exit 1
fi
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0)"
echo

View File

@ -2,6 +2,17 @@
set -e
set +x
if [[ "$(uname)" != "Darwin" ]]; then
echo "ERROR: this script is desgined to be run on OSX. Can't run on $(uname)"
exit 1
fi
MAC_MAJOR_MINOR_VERSION=$(sw_vers -productVersion | grep -o '^\d\+.\d\+')
if [[ $MAC_MAJOR_MINOR_VERSION != "10.14" ]]; then
echo "ERROR: this script is desgined to be run on OSX 10.14. Can't run on OSX $MAC_MAJOR_MINOR_VERSION"
exit 1
fi
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0)"
echo

View File

@ -2,6 +2,18 @@
set -e
set +x
if [[ "$(uname)" != "Darwin" ]]; then
echo "ERROR: this script is desgined to be run on OSX. Can't run on $(uname)"
exit 1
fi
MAC_MAJOR_MINOR_VERSION=$(sw_vers -productVersion | grep -o '^\d\+.\d\+')
if [[ $MAC_MAJOR_MINOR_VERSION != "10.15" ]]; then
echo "ERROR: this script is desgined to be run on OSX 10.15. Can't run on OSX $MAC_MAJOR_MINOR_VERSION"
exit 1
fi
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0) [firefox|webkit]"
echo

View File

@ -2,6 +2,12 @@
set -e
set +x
if [[ $(uname) != MINGW* ]]; then
echo "ERROR: this script is desgined to be run on MINGW. Can't run on $(uname)"
exit 1
fi
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0)"
echo