diff options
author | pommicket <pommicket@gmail.com> | 2025-09-19 12:57:11 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-19 12:57:28 -0400 |
commit | c53699a21bbb2f3884ecd74e6085efdbc2fc2a28 (patch) | |
tree | a35abdd17f27ea6a6fa369334f7284c413deb76a /publish.sh | |
parent | a27ffcd70ca9dfad9f7cd7a99fbae484d1719c10 (diff) |
Polishing, keyboard input, publish script
Diffstat (limited to 'publish.sh')
-rwxr-xr-x | publish.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..bd3fbb4 --- /dev/null +++ b/publish.sh @@ -0,0 +1,27 @@ +#!/bin/sh +RCLONE_ENDPOINT="${RCLONE_ENDPOINT:-linode-fr:/blankplays.pommicket.com/}" +S3CMD_HOST="${S3_HOST:-fr-par-1.linodeobjects.com}" +S3CMD_ENDPOINT="${S3_ENDPOINT:-s3://blankplays.pommicket.com}" + +EXCL2= +if [ "$1" = 'skip-challenges' ]; then + EXCL2='--exclude=/challenges-{{.*}}' +fi + +ls pub +printf "Copy this stuff to ${RCLONE_ENDPOINT} [y/n]? " +read ok +if [ "$ok" != 'y' ]; then + echo 'Aborted.' + exit 1 +fi + +rclone -P --transfers=16 --checkers=16 --exclude=/blankplays.js $EXCL2 --s3-acl=public-read copy pub/ "$RCLONE_ENDPOINT" || exit 1 +gzip -9 -c pub/blankplays.js > blankplays.gz.js || exit 1 +s3cmd -P -m 'text/javascript; charset=utf-8' \ + --host="$S3CMD_HOST" \ + --host-bucket='%(bucket)s.'"$S3CMD_HOST" \ + --add-header 'Content-Encoding: gzip' \ + put blankplays.gz.js "$S3CMD_ENDPOINT/blankplays.js" || exit 1 +rm blankplays.gz.js +echo 'Done.' |