From c53699a21bbb2f3884ecd74e6085efdbc2fc2a28 Mon Sep 17 00:00:00 2001 From: pommicket Date: Fri, 19 Sep 2025 12:57:11 -0400 Subject: Polishing, keyboard input, publish script --- publish.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 publish.sh (limited to 'publish.sh') 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.' -- cgit v1.2.3