mirror of
https://github.com/microsoft/playwright.git
synced 2024-10-28 06:07:53 +03:00
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:
parent
254a464828
commit
cf55fe660c
@ -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)
|
@ -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
|
49
browser_patches/buildbots/buildbot-mac-10.14.sh
Executable file
49
browser_patches/buildbots/buildbot-mac-10.14.sh
Executable 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
|
46
browser_patches/buildbots/buildbot-mac-10.15.sh
Executable file
46
browser_patches/buildbots/buildbot-mac-10.15.sh
Executable 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
|
@ -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;
|
1
browser_patches/buildbots/crontab
Normal file
1
browser_patches/buildbots/crontab
Normal file
@ -0,0 +1 @@
|
||||
*/5 * * * * . $HOME/.profile; $HOME/prog/cron/playwright/browser_patches/buildbots/buildbot-linux.sh >/tmp/buildbot-linux-cronjob.log
|
@ -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
|
Loading…
Reference in New Issue
Block a user