Blender-org web-assets v2 upgrade #104116

Merged
Márton Lente merged 56 commits from web-assets-v2-upgrade into main 2024-08-13 17:27:59 +02:00
Showing only changes of commit 6831d27f69 - Show all commits

View File

@ -1,17 +1,27 @@
#!/bin/bash -e #!/bin/bash -e
# Initialize flag dry-run as empty
DRY_RUN_FLAG=""
# Check for flag --dry-run in the first argument
if [[ "$1" == "--dry-run" ]]; then
DRY_RUN_FLAG="--dry-run"
shift # Shift arguments to the left, making $2 become $1
fi
case $1 in case $1 in
*blender.org*) *blender.org*)
DEPLOYHOST="$1" DEPLOYHOST="$1"
;; ;;
*) *)
echo "Usage:" >&2 echo "Usage:" >&2
echo "$0 blender.org" >&2 echo "$0 [--dry-run] blender.org" >&2
echo "$0 code.blender.org" >&2 echo "$0 [--dry-run] code.blender.org" >&2
exit 1 exit 1
;;
esac esac
echo -n "Deploying to ${DEPLOYHOST}" echo -n "Deploying to ${DEPLOYHOST} ${DRY_RUN_FLAG}"
echo echo
if ! ping blender.org -q -c 1 -W 2 >/dev/null; then if ! ping blender.org -q -c 1 -W 2 >/dev/null; then
@ -22,7 +32,6 @@ fi
echo "Press [ENTER] to continue, Ctrl+C to abort." echo "Press [ENTER] to continue, Ctrl+C to abort."
read dummy read dummy
# macOS does not support readlink -f, so we use greadlink instead # macOS does not support readlink -f, so we use greadlink instead
if [[ `uname` == 'Darwin' ]]; then if [[ `uname` == 'Darwin' ]]; then
command -v greadlink 2>/dev/null 2>&1 || { echo >&2 "Install greadlink using brew."; exit 1; } command -v greadlink 2>/dev/null 2>&1 || { echo >&2 "Install greadlink using brew."; exit 1; }
@ -41,7 +50,6 @@ if [ ! -d "$CONTENT" ]; then
exit 1 exit 1
fi fi
echo echo
echo "*** GULPA GULPA ***" echo "*** GULPA GULPA ***"
npm install npm install
@ -50,15 +58,15 @@ npm run build
echo echo
echo "*** SYNCING $1 ***" echo "*** SYNCING $1 ***"
# Deploy to blender.org with optional dry-run
if [[ "$1" == 'blender.org' ]]; then if [[ "$1" == 'blender.org' ]]; then
rsync -avh --filter="merge deploy-filter.txt" $CONTENT blender.org:/data/www/vhosts/www.blender.org/www/wp-content/ rsync $DRY_RUN_FLAG --checksum --human-readable -i --recursive --update --verbose --filter="merge deploy-filter.txt" $CONTENT blender.org:/data/www/vhosts/www.blender.org/www/wp-content/
fi elif [[ "$1" == 'code.blender.org' ]]; then
# Deploy to code.blender.org with optional dry-run
if [[ "$1" == 'code.blender.org' ]]; then rsync $DRY_RUN_FLAG --checksum --human-readable -i --recursive --update --verbose --filter="merge deploy-filter.txt" $CONTENT blender.org:/data/www/vhosts/code.blender.org/wordpress/wp-content/
rsync -avh --filter="merge deploy-filter.txt" $CONTENT blender.org:/data/www/vhosts/code.blender.org/wordpress/wp-content/
fi fi
echo echo
echo "===================================================================" echo "==================================================================="
echo "Deploy to ${DEPLOYHOST} is done." echo "Deploy to ${DEPLOYHOST} ${DRY_RUN_FLAG} is done."
echo "===================================================================" echo "==================================================================="