playwright/browser_patches/buildbots/buildbot-mac-10.14.sh
Andrey Lushnikov 245d1001b1
devops: produce ffmpeg builds on bots (#3820)
This patch moves FFMPEG building to buildbots:
- `ffmpeg-mac.zip` is built on Mac 10.14 machine
- `ffmpeg-win32.zip` and `ffmpeg-win64.zip` are cross-compiled on
  Ubuntu 20.04 machine

All builds across the platforms share the same config:
- the same versions of `ffmpeg` and `libvpx`
- the same build configuration for both `ffmpeg` and `libvpx`

The config could be found in the `//browser_patches/ffmpeg/CONFIG.sh`.

The builds will be then copied manually and committed to the git
repository.
2020-09-09 17:05:08 -07:00

71 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
set -e
set +x
if [[ "$(uname)" != "Darwin" ]]; then
echo "ERROR: this script is designed 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 designed 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
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")"
IS_FIRST_RUN_FILE="/tmp/pw-buildbot-first-run.txt";
if ! [[ -f $IS_FIRST_RUN_FILE ]]; then
source ./send_telegram_message.sh
send_telegram_message '**Mac 10.14 Buildbot Is Active**'
fi
touch "$IS_FIRST_RUN_FILE"
# 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-mac-10.14 >/tmp/$(basename $0)--firefox-mac.log || true
git pull origin master
../checkout_build_archive_upload.sh webkit-mac-10.14 >/tmp/$(basename $0)--webkit-mac-10.14.log || true
git pull origin master
../checkout_build_archive_upload.sh ffmpeg-mac >/tmp/$(basename $0)--ffmpeg-mac.log || true