본문 이미지 최적화 및 백필 보정
This commit is contained in:
40
scripts/backfill-post-thumbnails-production.sh
Executable file
40
scripts/backfill-post-thumbnails-production.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
APP_SERVICE=${APP_SERVICE:-sori-studio}
|
||||
COMPOSE_ENV_FILE=
|
||||
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
pick_compose_env_file() {
|
||||
if [ -n "${ENV_FILE:-}" ] && [ -r "$ENV_FILE" ]; then
|
||||
COMPOSE_ENV_FILE=$ENV_FILE
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -r .env.production ]; then
|
||||
COMPOSE_ENV_FILE=.env.production
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -r .env ]; then
|
||||
COMPOSE_ENV_FILE=.env
|
||||
return 0
|
||||
fi
|
||||
|
||||
COMPOSE_ENV_FILE=
|
||||
}
|
||||
|
||||
compose() {
|
||||
if [ -n "$COMPOSE_ENV_FILE" ]; then
|
||||
docker compose --env-file "$COMPOSE_ENV_FILE" "$@"
|
||||
return 0
|
||||
fi
|
||||
|
||||
docker compose "$@"
|
||||
}
|
||||
|
||||
pick_compose_env_file
|
||||
compose up -d "$APP_SERVICE"
|
||||
compose exec -T "$APP_SERVICE" node .output/server/scripts/backfill-post-thumbnails.js
|
||||
Reference in New Issue
Block a user