Spaces:
Runtime error
Runtime error
Ashira Pitchayapakayakul commited on
Commit Β·
147cb0f
1
Parent(s): 7d77adb
Non-blocking git clones + GIT_TERMINAL_PROMPT=0 + 30s timeout
Browse files
start.sh
CHANGED
|
@@ -45,6 +45,10 @@ mkdir -p ~/.hermes
|
|
| 45 |
chmod 600 ~/.hermes/.env
|
| 46 |
|
| 47 |
# ββ 3. Git config + clone axentx repos for auto-orchestrate auto-commit ββββ
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
GH_TOKEN=$(echo "${GITHUB_TOKEN_POOL:-}" | cut -d',' -f1)
|
| 49 |
if [[ -n "$GH_TOKEN" ]]; then
|
| 50 |
git config --global user.email "hermes@axentx.ai"
|
|
@@ -55,12 +59,10 @@ if [[ -n "$GH_TOKEN" ]]; then
|
|
| 55 |
|
| 56 |
PROJECTS_DIR="${DATA}/projects"
|
| 57 |
mkdir -p "$PROJECTS_DIR"
|
| 58 |
-
# Symlink to the path auto-orchestrate-loop expects
|
| 59 |
rm -rf ~/axentx 2>/dev/null
|
| 60 |
ln -sfn "$PROJECTS_DIR" ~/axentx
|
| 61 |
|
| 62 |
-
# Clone axentx repos
|
| 63 |
-
# Note: axiomops dropped (using arkship instead). arkship lives under arkashira org.
|
| 64 |
for repo_spec in \
|
| 65 |
"Costinel:AXENTX/Costinel" \
|
| 66 |
"Vanguard:AXENTX/vanguard" \
|
|
@@ -69,23 +71,25 @@ if [[ -n "$GH_TOKEN" ]]; then
|
|
| 69 |
local_name="${repo_spec%%:*}"
|
| 70 |
gh_path="${repo_spec##*:}"
|
| 71 |
target="${PROJECTS_DIR}/${local_name}"
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
>> "$LOG_DIR/git-pull.log" 2>&1 || true
|
| 81 |
-
|
|
|
|
| 82 |
done
|
|
|
|
| 83 |
|
| 84 |
# Persist token for any push from auto-orchestrate
|
| 85 |
git config --global credential.helper "store --file=$HOME/.git-credentials"
|
| 86 |
echo "https://x-access-token:${GH_TOKEN}@github.com" > ~/.git-credentials
|
| 87 |
chmod 600 ~/.git-credentials
|
| 88 |
-
echo "[$(date +%H:%M:%S)] git auth configured +
|
| 89 |
fi
|
| 90 |
|
| 91 |
# ββ 4. Redis (TCP only) βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 45 |
chmod 600 ~/.hermes/.env
|
| 46 |
|
| 47 |
# ββ 3. Git config + clone axentx repos for auto-orchestrate auto-commit ββββ
|
| 48 |
+
# Disable interactive prompts globally so failed-auth git ops fail fast.
|
| 49 |
+
export GIT_TERMINAL_PROMPT=0
|
| 50 |
+
export GIT_ASKPASS=/bin/true
|
| 51 |
+
|
| 52 |
GH_TOKEN=$(echo "${GITHUB_TOKEN_POOL:-}" | cut -d',' -f1)
|
| 53 |
if [[ -n "$GH_TOKEN" ]]; then
|
| 54 |
git config --global user.email "hermes@axentx.ai"
|
|
|
|
| 59 |
|
| 60 |
PROJECTS_DIR="${DATA}/projects"
|
| 61 |
mkdir -p "$PROJECTS_DIR"
|
|
|
|
| 62 |
rm -rf ~/axentx 2>/dev/null
|
| 63 |
ln -sfn "$PROJECTS_DIR" ~/axentx
|
| 64 |
|
| 65 |
+
# Clone axentx repos in background with hard timeout β never blocks boot
|
|
|
|
| 66 |
for repo_spec in \
|
| 67 |
"Costinel:AXENTX/Costinel" \
|
| 68 |
"Vanguard:AXENTX/vanguard" \
|
|
|
|
| 71 |
local_name="${repo_spec%%:*}"
|
| 72 |
gh_path="${repo_spec##*:}"
|
| 73 |
target="${PROJECTS_DIR}/${local_name}"
|
| 74 |
+
(
|
| 75 |
+
if [[ ! -d "$target/.git" ]]; then
|
| 76 |
+
echo "[$(date +%H:%M:%S)] cloning $gh_path..." >> "$LOG_DIR/boot.log"
|
| 77 |
+
timeout 30 git clone --depth 50 \
|
| 78 |
+
"https://x-access-token:${GH_TOKEN}@github.com/${gh_path}.git" "$target" \
|
| 79 |
+
>> "$LOG_DIR/git-clone.log" 2>&1 || \
|
| 80 |
+
echo "[$(date +%H:%M:%S)] WARN: clone $gh_path failed/timeout" >> "$LOG_DIR/boot.log"
|
| 81 |
+
else
|
| 82 |
+
cd "$target" && timeout 20 git pull --rebase >> "$LOG_DIR/git-pull.log" 2>&1 || true
|
| 83 |
+
fi
|
| 84 |
+
) &
|
| 85 |
done
|
| 86 |
+
# Don't wait β let clones finish in background while boot continues
|
| 87 |
|
| 88 |
# Persist token for any push from auto-orchestrate
|
| 89 |
git config --global credential.helper "store --file=$HOME/.git-credentials"
|
| 90 |
echo "https://x-access-token:${GH_TOKEN}@github.com" > ~/.git-credentials
|
| 91 |
chmod 600 ~/.git-credentials
|
| 92 |
+
echo "[$(date +%H:%M:%S)] git auth configured + clone jobs spawned" >> "$LOG_DIR/boot.log"
|
| 93 |
fi
|
| 94 |
|
| 95 |
# ββ 4. Redis (TCP only) βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|