Fix deploy_service to expose git clone errors instead of swallowing them
Removed &>/dev/null suppression; output is now captured and shown in msg_error with a debug command when clone or pull fails. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
86dd283acd
commit
4fe4e30807
1 changed files with 11 additions and 4 deletions
|
|
@ -480,10 +480,17 @@ deploy_service() {
|
||||||
local id=$1 repo_name=$2 local_src=$3 dest=$4
|
local id=$1 repo_name=$2 local_src=$3 dest=$4
|
||||||
if [[ "$USE_FORGEJO" == "true" ]]; then
|
if [[ "$USE_FORGEJO" == "true" ]]; then
|
||||||
local url; url=$(build_clone_url "$repo_name")
|
local url; url=$(build_clone_url "$repo_name")
|
||||||
pct exec "$id" -- bash -c "
|
local out
|
||||||
if [ -d '${dest}/.git' ]; then cd '${dest}' && git pull -q; \
|
out=$(pct exec "$id" -- bash -c "
|
||||||
else git clone -q '${url}' '${dest}'; fi
|
if [ -d '${dest}/.git' ]; then
|
||||||
" &>/dev/null
|
cd '${dest}' && git pull 2>&1
|
||||||
|
else
|
||||||
|
git clone '${url}' '${dest}' 2>&1
|
||||||
|
fi
|
||||||
|
" 2>&1) || msg_error "Deploy of ${repo_name} to LXC ${id} failed:
|
||||||
|
${out}
|
||||||
|
|
||||||
|
Debug: pct enter ${id} && git clone ${url//oauth2:*@/} /tmp/test-clone"
|
||||||
else
|
else
|
||||||
push_dir "$id" "$local_src" "$dest"
|
push_dir "$id" "$local_src" "$dest"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue