SPB Git forge
29commits 1branches 0releases
684.0 KBsize
maindefault branch
2 days agolast push
Python 95.8% Shell 4.2%

rebuild désactivable par manifeste ; prepare : ngrok.yml via write_remote_file, pm2 fallback npm

Simon-Pierre Boucher committed 19 days ago (Sep 4, 2026) parent f7a1e39

2 changed files +5 −5

modified mld/deploy.py +1 −1
@@ -165,7 +165,7 @@ def deploy(app, alias, reinstall=False, skip_sync=False):
165 165 if reinstall:
166 166 script += "if [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile; elif [ -f package-lock.json ]; then npm ci; elif [ -f package.json ]; then npm install; fi\n"
167 167 script += "if [ -f requirements.txt ] && [ -x .venv/bin/pip ]; then .venv/bin/pip install -q -r requirements.txt; fi\n"
168 elif os.path.exists(os.path.join(sd, "package.json")) and os.path.isdir(os.path.join(sd, "node_modules")):
168 + elif m.get("rebuild", True) and os.path.exists(os.path.join(sd, "package.json")) and os.path.isdir(os.path.join(sd, "node_modules")):
169 169 script += "npm rebuild >/dev/null 2>&1 && echo ' npm rebuild ok' || echo ' npm rebuild: avertissement'\n"
170 170 script += _install_hooks(m, ip, ctx)
171 171 rc, out, err = ssh.run(ip, script, timeout=1800)
modified mld/prepare.py +4 −4
@@ -25,15 +25,15 @@ def prepare(alias, runtimes=None, ka_helpers=False):
25 25 script = ""
26 26 for r in missing:
27 27 if r in config.BREW_FORMULAE:
28 script += "echo ' brew install %s'; brew install -q %s >/dev/null 2>&1 || echo ' ! échec %s'\n" % (r, config.BREW_FORMULAE[r], r)
28 + fallback = " || npm install -g pm2 >/dev/null 2>&1" if r == "pm2" else ""
29 + script += "echo ' brew install %s'; brew install -q %s >/dev/null 2>&1%s || echo ' ! échec %s'\n" % (r, config.BREW_FORMULAE[r], fallback, r)
29 30 elif r in config.BREW_CASKS:
30 31 script += "echo ' brew install --cask ngrok'; brew install -q --cask ngrok >/dev/null 2>&1 || brew install -q ngrok/ngrok/ngrok >/dev/null 2>&1 || echo ' ! échec ngrok'\n"
31 32 # config ngrok (authtoken) depuis la passerelle
32 33 if "ngrok" in missing or not have.get("ngrok"):
33 34 if os.path.exists(config.NGROK_CFG):
34 ssh.run(ip, "mkdir -p \"$HOME/Library/Application Support/ngrok\"")
35 ssh.scp_to(ip, config.NGROK_CFG, "'/Users/%s/Library/Application Support/ngrok/ngrok.yml'" % config.USER)
36 script += "echo ' ngrok.yml copié'\n"
35 + rc0, _, _ = ssh.write_remote_file(ip, "/Users/%s/Library/Application Support/ngrok/ngrok.yml" % config.USER, open(config.NGROK_CFG).read(), mode="600")
36 + script += "echo ' ngrok.yml %s'\n" % ("copié" if rc0 == 0 else "ÉCHEC de copie")
37 37 # marqueur
38 38 script += "[ -f ~/.maclustr-node ] || echo %s > ~/.maclustr-node\n" % alias
39 39 # pm2 startup (launchd) — nécessite sudo
40 40