devops: give all 4 buildbots designated bash script

This makes it possible for every buildbot to build browsers one-by-one,
instead of altogether.
This commit is contained in:
Andrey Lushnikov 2019-11-22 20:25:36 -08:00
parent 254a464828
commit cf55fe660c
7 changed files with 108 additions and 34 deletions

View File

@ -59,5 +59,5 @@ Run `c:\mozilla-build\start-shell.bat` and checkout PlayWright repo to `/c/playw
## Running Build Loop
1. Launch `c:\mozilla-build/start-shell.bat`
2. Run `/c/playwright/browser_patches/tools/poll_build.sh`
2. Run `/c/playwright/browser_patches/buildbots/buildbot-windows.sh`
3. Disable "QuickEdit" terminal mode to avoid [terminal freezing and postponing builds](https://stackoverflow.com/questions/33883530/why-is-my-command-prompt-freezing-on-windows-10)

View File

@ -7,15 +7,11 @@ if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo
echo "Pull from upstream & run checkout_build_archive_upload.sh"
echo "in a safe way so that multiple instances of the script cannot be run"
echo
echo "This script is designed to be run as a cronjob"
exit 0
fi
if [[ $# == 0 ]]; then
echo "missing browser: 'firefox' or 'webkit'"
echo "try './$(basename $0) --help' for more information"
exit 1
fi
if [[ (-z $AZ_ACCOUNT_KEY) || (-z $AZ_ACCOUNT_NAME) ]]; then
echo "ERROR: Either \$AZ_ACCOUNT_KEY or \$AZ_ACCOUNT_NAME environment variable is missing."
echo " 'Azure Account Name' and 'Azure Account Key' secrets that are required"
@ -28,22 +24,13 @@ if ! command -v az >/dev/null; then
exit 1
fi
BROWSER_NAME=""
if [[ ("$1" == "firefox") || ("$1" == "firefox/") ]]; then
BROWSER_NAME="firefox"
elif [[ ("$1" == "webkit") || ("$1" == "webkit/") ]]; then
BROWSER_NAME="webkit"
else
echo ERROR: unknown browser - "$1"
exit 1
fi
# Setup a LOCKDIR so that we don't run the same script multiple times.
LOCKDIR="/tmp/playwright__$(basename $0)-$BROWSER_NAME.lock"
LOCKDIR="/tmp/$(basename $0).lock"
if [[ -d ${LOCKDIR} ]]; then
echo "Already running (lockdir $LOCKDIR exists. Remove it manually if running)"
exit 0
fi
mkdir -p $LOCKDIR
# make sure the lockfile is removed when we exit and then claim it
trap "rm -rf ${LOCKDIR}; cd $(pwd -P); exit" INT TERM EXIT
@ -51,9 +38,12 @@ cd "$(dirname "$0")"
# Check if git repo is dirty.
if [[ -n $(git status -s) ]]; then
echo "ERROR: $FRIENDLY_CHECKOUT_PATH has dirty GIT state - commit everything and re-run the script."
echo "ERROR: dirty GIT state - commit everything and re-run the script."
exit 1
fi
git pull origin master
../checkout_build_archive_upload.sh $BROWSER_NAME >/tmp/checkout_build_archive_upload--$BROWSER_NAME.log
../checkout_build_archive_upload.sh firefox >/tmp/$(basename $0)-firefox-log.log
git pull origin master
../checkout_build_archive_upload.sh webkit >/tmp/$(basename $0)-webkit-log.log

View File

@ -0,0 +1,49 @@
#!/bin/bash
set -e
set +x
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0) [firefox|webkit]"
echo
echo "Pull from upstream & run checkout_build_archive_upload.sh"
echo "in a safe way so that multiple instances of the script cannot be run"
echo
echo "This script is designed to be run as a cronjob"
exit 0
fi
if [[ (-z $AZ_ACCOUNT_KEY) || (-z $AZ_ACCOUNT_NAME) ]]; then
echo "ERROR: Either \$AZ_ACCOUNT_KEY or \$AZ_ACCOUNT_NAME environment variable is missing."
echo " 'Azure Account Name' and 'Azure Account Key' secrets that are required"
echo " to upload builds ot Azure CDN."
exit 1
fi
if ! command -v az >/dev/null; then
echo "ERROR: az is not found in PATH"
exit 1
fi
# Setup a LOCKDIR so that we don't run the same script multiple times.
LOCKDIR="/tmp/$(basename $0).lock"
if [[ -d ${LOCKDIR} ]]; then
echo "Already running (lockdir $LOCKDIR exists. Remove it manually if running)"
exit 0
fi
mkdir -p $LOCKDIR
# make sure the lockfile is removed when we exit and then claim it
trap "rm -rf ${LOCKDIR}; cd $(pwd -P); exit" INT TERM EXIT
cd "$(dirname "$0")"
# Check if git repo is dirty.
if [[ -n $(git status -s) ]]; then
echo "ERROR: dirty GIT state - commit everything and re-run the script."
exit 1
fi
git pull origin master
../checkout_build_archive_upload.sh firefox >/tmp/$(basename $0)-firefox-log.log
git pull origin master
../checkout_build_archive_upload.sh webkit >/tmp/$(basename $0)-webkit-log.log

View File

@ -0,0 +1,46 @@
#!/bin/bash
set -e
set +x
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0) [firefox|webkit]"
echo
echo "Pull from upstream & run checkout_build_archive_upload.sh"
echo "in a safe way so that multiple instances of the script cannot be run"
echo
echo "This script is designed to be run as a cronjob"
exit 0
fi
if [[ (-z $AZ_ACCOUNT_KEY) || (-z $AZ_ACCOUNT_NAME) ]]; then
echo "ERROR: Either \$AZ_ACCOUNT_KEY or \$AZ_ACCOUNT_NAME environment variable is missing."
echo " 'Azure Account Name' and 'Azure Account Key' secrets that are required"
echo " to upload builds ot Azure CDN."
exit 1
fi
if ! command -v az >/dev/null; then
echo "ERROR: az is not found in PATH"
exit 1
fi
# Setup a LOCKDIR so that we don't run the same script multiple times.
LOCKDIR="/tmp/$(basename $0).lock"
if [[ -d ${LOCKDIR} ]]; then
echo "Already running (lockdir $LOCKDIR exists. Remove it manually if running)"
exit 0
fi
mkdir -p $LOCKDIR
# make sure the lockfile is removed when we exit and then claim it
trap "rm -rf ${LOCKDIR}; cd $(pwd -P); exit" INT TERM EXIT
cd "$(dirname "$0")"
# Check if git repo is dirty.
if [[ -n $(git status -s) ]]; then
echo "ERROR: dirty GIT state - commit everything and re-run the script."
exit 1
fi
git pull origin master
../checkout_build_archive_upload.sh webkit >/tmp/$(basename $0)-webkit-log.log

View File

@ -26,23 +26,13 @@ if ! command -v az >/dev/null; then
exit 1
fi
BROWSER_NAME=""
if [[ ("$1" == "firefox") || ("$1" == "firefox/") ]]; then
BROWSER_NAME="firefox"
elif [[ ("$1" == "webkit") || ("$1" == "webkit/") ]]; then
BROWSER_NAME="webkit"
else
echo ERROR: unknown browser - "$1"
exit 1
fi
# make sure the lockfile is removed when we exit and then claim it
trap "cd $(pwd -P);" EXIT
cd "$(dirname "$0")"
# Check if git repo is dirty.
if [[ -n $(git status -s) ]]; then
echo "ERROR: $FRIENDLY_CHECKOUT_PATH has dirty GIT state - commit everything and re-run the script."
echo "ERROR: dirty GIT state - commit everything and re-run the script."
exit 1
fi
@ -51,7 +41,7 @@ while true; do
iteration=$(( iteration + 1 ))
echo "== ITERATION ${iteration} =="
git pull origin master
../checkout_build_archive_upload.sh $BROWSER_NAME
../checkout_build_archive_upload.sh firefox
echo "------ Sleeping for 300 seconds before next turn... ------"
sleep 300
done;

View File

@ -0,0 +1 @@
*/5 * * * * . $HOME/.profile; $HOME/prog/cron/playwright/browser_patches/buildbots/buildbot-linux.sh >/tmp/buildbot-linux-cronjob.log

View File

@ -1,2 +0,0 @@
*/1 * * * * . $HOME/.profile; $HOME/prog/cron/playwright/browser_patches/tools/cronjob.sh webkit &>/tmp/playwright-cronjob-building-log-webkit.txt
*/1 * * * * . $HOME/.profile; $HOME/prog/cron/playwright/browser_patches/tools/cronjob.sh firefox &>/tmp/playwright-cronjob-building-log-firefox.txt