Files
thekims.family/media.sh
T
timothykim 2bdddd3188
Build and Push Docker Image / build (push) Successful in 11s
adds dashbaord init
2026-04-16 13:55:10 -04:00

28 lines
562 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
BUCKET="$(basename "$(cd "$(dirname "$0")" && pwd)")"
ENDPOINT="https://s3.hantim.net"
LOCAL_DIR="static/media"
usage() {
echo "usage: $0 <pull|push>"
echo " pull download media from garage to $LOCAL_DIR/"
echo " push upload media from $LOCAL_DIR/ to garage"
exit 1
}
[[ $# -eq 1 ]] || usage
case "$1" in
pull)
aws --endpoint-url "$ENDPOINT" s3 sync "s3://$BUCKET/" "$LOCAL_DIR/"
;;
push)
aws --endpoint-url "$ENDPOINT" s3 sync "$LOCAL_DIR/" "s3://$BUCKET/"
;;
*)
usage
;;
esac