18 lines
363 B
Bash
Executable File
18 lines
363 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
branch="${1:-main}"
|
|
target_dir="${2:-/srv/egbim_homepage}"
|
|
|
|
mkdir -p "$target_dir"
|
|
cd "$target_dir"
|
|
|
|
if [[ ! -d .git ]]; then
|
|
git clone --branch "$branch" https://gitea.hmac.kr/b24014/egbim_homepage.git .
|
|
else
|
|
git fetch origin
|
|
git checkout "$branch"
|
|
git reset --hard "origin/$branch"
|
|
fi
|
|
|
|
docker compose up -d --build |