2019-11-23 04:36:12 +03:00
|
|
|
#!/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 in a loop"
|
|
|
|
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"
|
|
|
|
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
|
|
|
|
|
|
|
|
# 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
|
2019-11-23 07:25:36 +03:00
|
|
|
echo "ERROR: dirty GIT state - commit everything and re-run the script."
|
2019-11-23 04:36:12 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-11-23 05:55:29 +03:00
|
|
|
iteration=0
|
2019-11-23 04:36:12 +03:00
|
|
|
while true; do
|
2019-11-23 05:55:29 +03:00
|
|
|
iteration=$(( iteration + 1 ))
|
|
|
|
echo "== ITERATION ${iteration} =="
|
2019-11-23 04:36:12 +03:00
|
|
|
git pull origin master
|
2019-11-23 07:25:36 +03:00
|
|
|
../checkout_build_archive_upload.sh firefox
|
2019-11-23 04:36:12 +03:00
|
|
|
echo "------ Sleeping for 300 seconds before next turn... ------"
|
|
|
|
sleep 300
|
|
|
|
done;
|