Skip to content

Commit cb77d33

Browse files
authored
devops: add script for ubuntu 20.04 buildbot (#3123)
This will start producing Ubuntu 20.04 webkit builds References #2745
1 parent d2f24e8 commit cb77d33

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash
2+
set -e
3+
set +x
4+
5+
if [[ $(uname) != "Linux" ]]; then
6+
echo "ERROR: this script is designed to be run on Linux. Can't run on $(uname)"
7+
exit 1
8+
fi
9+
10+
CURRENT_HOST_OS="$(bash -c 'source /etc/os-release && echo $NAME')"
11+
CURRENT_HOST_OS_VERSION="$(bash -c 'source /etc/os-release && echo $VERSION_ID')"
12+
13+
if [[ "$CURRENT_HOST_OS" != "Ubuntu" || "$CURRENT_HOST_OS_VERSION" != "20.04" ]]; then
14+
echo "ERROR: this script is designed to be run on Ubuntu 20.04. Can't run on $CURRENT_HOST_OS $CURRENT_HOST_OS_VERSION"
15+
exit 1
16+
fi
17+
18+
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
19+
echo "usage: $(basename $0)"
20+
echo
21+
echo "Pull from upstream & run checkout_build_archive_upload.sh"
22+
echo "in a safe way so that multiple instances of the script cannot be run"
23+
echo
24+
echo "This script is designed to be run as a cronjob"
25+
exit 0
26+
fi
27+
28+
if [[ (-z $AZ_ACCOUNT_KEY) || (-z $AZ_ACCOUNT_NAME) ]]; then
29+
echo "ERROR: Either \$AZ_ACCOUNT_KEY or \$AZ_ACCOUNT_NAME environment variable is missing."
30+
echo " 'Azure Account Name' and 'Azure Account Key' secrets that are required"
31+
echo " to upload builds ot Azure CDN."
32+
exit 1
33+
fi
34+
35+
if ! command -v az >/dev/null; then
36+
echo "ERROR: az is not found in PATH"
37+
exit 1
38+
fi
39+
40+
# Setup a LOCKDIR so that we don't run the same script multiple times.
41+
LOCKDIR="/tmp/$(basename $0).lock"
42+
if [[ -d ${LOCKDIR} ]]; then
43+
echo "Already running (lockdir $LOCKDIR exists. Remove it manually if running)"
44+
exit 0
45+
fi
46+
47+
mkdir -p $LOCKDIR
48+
# make sure the lockfile is removed when we exit and then claim it
49+
trap "rm -rf ${LOCKDIR}; cd $(pwd -P); exit" INT TERM EXIT
50+
cd "$(dirname "$0")"
51+
52+
IS_FIRST_RUN_FILE="/tmp/pw-buildbot-first-run.txt";
53+
if ! [[ -f $IS_FIRST_RUN_FILE ]]; then
54+
source ./send_telegram_message.sh
55+
send_telegram_message '**Linux Buildbot Is Active**'
56+
fi
57+
touch "$IS_FIRST_RUN_FILE"
58+
59+
# Check if git repo is dirty.
60+
if [[ -n $(git status -s) ]]; then
61+
echo "ERROR: dirty GIT state - commit everything and re-run the script."
62+
exit 1
63+
fi
64+
65+
git pull origin master
66+
../checkout_build_archive_upload.sh webkit-gtk-ubuntu-20.04 >/tmp/$(basename $0)--webkit-gtk.log || true
67+
../checkout_build_archive_upload.sh webkit-wpe-ubuntu-20.04 >/tmp/$(basename $0)--webkit-wpe.log || true
68+
../checkout_build_archive_upload.sh webkit-gtk-wpe-ubuntu-20.04 >/tmp/$(basename $0)--webkit-gtk-wpe.log || true

browser_patches/checkout_build_archive_upload.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,25 @@ elif [[ "$BUILD_FLAVOR" == "webkit-gtk-wpe-ubuntu-18.04" ]]; then
7575
EXPECTED_HOST_OS="Ubuntu"
7676
EXPECTED_HOST_OS_VERSION="18.04"
7777
BUILD_BLOB_NAME="minibrowser-gtk-wpe-ubuntu-18.04.zip"
78+
elif [[ "$BUILD_FLAVOR" == "webkit-gtk-ubuntu-20.04" ]]; then
79+
BROWSER_NAME="webkit"
80+
EXTRA_BUILD_ARGS="--gtk"
81+
EXTRA_ARCHIVE_ARGS="--gtk"
82+
EXPECTED_HOST_OS="Ubuntu"
83+
EXPECTED_HOST_OS_VERSION="20.04"
84+
BUILD_BLOB_NAME="minibrowser-gtk-ubuntu-20.04.zip"
85+
elif [[ "$BUILD_FLAVOR" == "webkit-wpe-ubuntu-20.04" ]]; then
86+
BROWSER_NAME="webkit"
87+
EXTRA_BUILD_ARGS="--wpe"
88+
EXTRA_ARCHIVE_ARGS="--wpe"
89+
EXPECTED_HOST_OS="Ubuntu"
90+
EXPECTED_HOST_OS_VERSION="20.04"
91+
BUILD_BLOB_NAME="minibrowser-wpe-ubuntu-20.04.zip"
92+
elif [[ "$BUILD_FLAVOR" == "webkit-gtk-wpe-ubuntu-20.04" ]]; then
93+
BROWSER_NAME="webkit"
94+
EXPECTED_HOST_OS="Ubuntu"
95+
EXPECTED_HOST_OS_VERSION="20.04"
96+
BUILD_BLOB_NAME="minibrowser-gtk-wpe-ubuntu-20.04.zip"
7897
elif [[ "$BUILD_FLAVOR" == "webkit-win64" ]]; then
7998
BROWSER_NAME="webkit"
8099
EXPECTED_HOST_OS="MINGW"

0 commit comments

Comments
 (0)