fix: deploy hook pulls via HTTPS, not SSH origin
The hook container has no ssh binary; origin on boka is ssh://. Always pull from the HTTPS remote URL instead. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+6
-4
@@ -3,6 +3,7 @@ set -euo pipefail
|
|||||||
|
|
||||||
REPO_DIR="/repo"
|
REPO_DIR="/repo"
|
||||||
BRANCH="${DEPLOY_BRANCH:-main}"
|
BRANCH="${DEPLOY_BRANCH:-main}"
|
||||||
|
HTTPS_URL="${DEPLOY_GIT_URL:-https://gitea.schwenk.online/froxxxy/playground.git}"
|
||||||
|
|
||||||
if [ ! -d "${REPO_DIR}/.git" ]; then
|
if [ ! -d "${REPO_DIR}/.git" ]; then
|
||||||
echo "Error: ${REPO_DIR} is not a git repository"
|
echo "Error: ${REPO_DIR} is not a git repository"
|
||||||
@@ -11,16 +12,17 @@ fi
|
|||||||
|
|
||||||
cd "${REPO_DIR}"
|
cd "${REPO_DIR}"
|
||||||
|
|
||||||
# Container has no writable $HOME — avoid git config --global (//.gitconfig)
|
# Container has no ssh client and no writable $HOME for git config --global
|
||||||
git_cmd() {
|
git_cmd() {
|
||||||
git -c "safe.directory=${REPO_DIR}" "$@"
|
git -c "safe.directory=${REPO_DIR}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -n "${DEPLOY_GIT_TOKEN:-}" ]; then
|
if [ -n "${DEPLOY_GIT_TOKEN:-}" ]; then
|
||||||
auth_url="https://oauth2:${DEPLOY_GIT_TOKEN}@gitea.schwenk.online/froxxxy/playground.git"
|
pull_url="https://oauth2:${DEPLOY_GIT_TOKEN}@gitea.schwenk.online/froxxxy/playground.git"
|
||||||
git_cmd pull "${auth_url}" "${BRANCH}"
|
|
||||||
else
|
else
|
||||||
git_cmd pull origin "${BRANCH}"
|
pull_url="${HTTPS_URL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
git_cmd pull "${pull_url}" "${BRANCH}"
|
||||||
|
|
||||||
echo "Deploy pull completed for ${BRANCH}"
|
echo "Deploy pull completed for ${BRANCH}"
|
||||||
|
|||||||
Reference in New Issue
Block a user