diff --git a/install-stack.sh b/install-stack.sh index e60f61c..efb21d8 100755 --- a/install-stack.sh +++ b/install-stack.sh @@ -480,17 +480,21 @@ deploy_service() { local id=$1 repo_name=$2 local_src=$3 dest=$4 if [[ "$USE_FORGEJO" == "true" ]]; then local url; url=$(build_clone_url "$repo_name") - local out - out=$(pct exec "$id" -- bash -c " + local tmp; tmp=$(mktemp /tmp/hotel-manage-deploy-out-XXXX) + if ! pct exec "$id" -- bash -c " if [ -d '${dest}/.git' ]; then - cd '${dest}' && git pull 2>&1 + cd '${dest}' && git pull else - git clone '${url}' '${dest}' 2>&1 + git clone '${url}' '${dest}' fi - " 2>&1) || msg_error "Deploy of ${repo_name} to LXC ${id} failed: + " > "$tmp" 2>&1; then + local out; out=$(cat "$tmp"); rm -f "$tmp" + msg_error "Deploy of ${repo_name} to LXC ${id} failed: ${out} - Debug: pct enter ${id} && git clone ${url//oauth2:*@/} /tmp/test-clone" + Debug: pct enter ${id} && git clone ${FORGEJO_BASE}/${repo_name}.git /tmp/test-clone" + fi + rm -f "$tmp" else push_dir "$id" "$local_src" "$dest" fi