Use explicit credentials for deployment polling

This commit is contained in:
shkim
2026-05-10 20:13:57 +09:00
parent 1fe15ea3ea
commit c07777371d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ LOG_FILE="$APP_DIR/data/deploy.log"
mkdir -p "$APP_DIR/data" mkdir -p "$APP_DIR/data"
cd "$APP_DIR" cd "$APP_DIR"
remote_rev="$(git ls-remote origin refs/heads/main | awk '{print $1}')" remote_rev="$(git -c credential.helper="store --file=/var/services/homes/whitekomani/.git-credentials" ls-remote origin refs/heads/main | awk '{print $1}')"
if [ -z "$remote_rev" ]; then if [ -z "$remote_rev" ]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') no remote revision found" >> "$LOG_FILE" echo "$(date '+%Y-%m-%d %H:%M:%S') no remote revision found" >> "$LOG_FILE"
exit 1 exit 1
+1 -1
View File
@@ -16,7 +16,7 @@ trap 'rmdir "$LOCK_DIR"' EXIT
cd "$APP_DIR" cd "$APP_DIR"
echo "$(date '+%Y-%m-%d %H:%M:%S') deploy start" >> "$LOG_FILE" echo "$(date '+%Y-%m-%d %H:%M:%S') deploy start" >> "$LOG_FILE"
git fetch origin main >> "$LOG_FILE" 2>&1 git -c credential.helper="store --file=/var/services/homes/whitekomani/.git-credentials" fetch origin main >> "$LOG_FILE" 2>&1
git reset --hard origin/main >> "$LOG_FILE" 2>&1 git reset --hard origin/main >> "$LOG_FILE" 2>&1
/usr/local/bin/docker build -t photoreq:latest . >> "$LOG_FILE" 2>&1 /usr/local/bin/docker build -t photoreq:latest . >> "$LOG_FILE" 2>&1