Blender-org web-assets v2 upgrade #104116
30
deploy.sh
30
deploy.sh
@ -1,17 +1,27 @@
|
||||
#!/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
|
||||
*blender.org*)
|
||||
DEPLOYHOST="$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage:" >&2
|
||||
echo "$0 blender.org" >&2
|
||||
echo "$0 code.blender.org" >&2
|
||||
echo "$0 [--dry-run] blender.org" >&2
|
||||
echo "$0 [--dry-run] code.blender.org" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo -n "Deploying to ${DEPLOYHOST}"
|
||||
echo -n "Deploying to ${DEPLOYHOST} ${DRY_RUN_FLAG}"
|
||||
echo
|
||||
|
||||
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."
|
||||
read dummy
|
||||
|
||||
|
||||
# macOS does not support readlink -f, so we use greadlink instead
|
||||
if [[ `uname` == 'Darwin' ]]; then
|
||||
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
|
||||
fi
|
||||
|
||||
|
||||
echo
|
||||
echo "*** GULPA GULPA ***"
|
||||
npm install
|
||||
@ -50,15 +58,15 @@ npm run build
|
||||
echo
|
||||
echo "*** SYNCING $1 ***"
|
||||
|
||||
# Deploy to blender.org with optional dry-run
|
||||
if [[ "$1" == 'blender.org' ]]; then
|
||||
rsync -avh --filter="merge deploy-filter.txt" $CONTENT blender.org:/data/www/vhosts/www.blender.org/www/wp-content/
|
||||
fi
|
||||
|
||||
if [[ "$1" == 'code.blender.org' ]]; then
|
||||
rsync -avh --filter="merge deploy-filter.txt" $CONTENT blender.org:/data/www/vhosts/code.blender.org/wordpress/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/
|
||||
elif [[ "$1" == 'code.blender.org' ]]; then
|
||||
# Deploy to code.blender.org with optional dry-run
|
||||
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/
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "==================================================================="
|
||||
echo "Deploy to ${DEPLOYHOST} is done."
|
||||
echo "Deploy to ${DEPLOYHOST} ${DRY_RUN_FLAG} is done."
|
||||
echo "==================================================================="
|
||||
|
Loading…
Reference in New Issue
Block a user