fix(deploy): expand sparse checkout so microservices deploy (run #120 fix) #103

Merged
shad0w merged 1 commit from fix/deploy-services-sparse-checkout into master 2026-06-23 21:43:43 +00:00
Owner

Root cause of the failed v0.3.0 deploy (run #120)

The microservice step logged:

skip GstService (absent)
skip EpfoService (absent)
skip PdfService (absent)
[PM2][ERROR] File ecosystem.config.js not found

Every service folder and the root ecosystem.config.js were missing from ~/pms, even though they're in the tag. The app deploys fine and prod stayed healthy (/login → 200) because ~/pms is a sparse checkout limited to App/ — historically only the app deployed, so git checkout -f $TAG never materialised anything outside App/. It was never a port clash or build error.

Fix

In deploy.yml, before managing services:

  • git sparse-checkout disable (+ clear the legacy core.sparseCheckout config and .git/info/sparse-checkout), then re-checkout the tag to materialise the full tree. Idempotent — a no-op once expanded, and harmless if the checkout was never sparse.
  • Guard the pm2 call: if ecosystem.config.js is somehow still absent, fail with a clear diagnostic (and sparse-checkout list) instead of the cryptic [PM2][ERROR].
  • README updated.

To verify / re-deploy

This only changes the workflow, so it needs a fresh tag to re-run:

git pull && git tag v0.3.1 && git push origin v0.3.1

Watch run under Actions. On that run the step should now print === Building GstService === / EpfoService and bring them up under pm2 (gst-service:3003, epfo-service:3004), then health-check them. PdfService is still skipped until #101 merges.

One independent caveat still stands from #102: if GstService/EpfoService were already running on pms1 under different pm2 names, delete those once (pm2 delete <old> && pm2 save) so the canonical names can bind their ports.

🤖 Generated with Claude Code

## Root cause of the failed `v0.3.0` deploy (run #120) The microservice step logged: ``` skip GstService (absent) skip EpfoService (absent) skip PdfService (absent) [PM2][ERROR] File ecosystem.config.js not found ``` Every service folder **and** the root `ecosystem.config.js` were missing from `~/pms`, even though they're in the tag. The app deploys fine and prod stayed healthy (`/login` → 200) because **`~/pms` is a sparse checkout limited to `App/`** — historically only the app deployed, so `git checkout -f $TAG` never materialised anything outside `App/`. It was never a port clash or build error. ## Fix In `deploy.yml`, before managing services: - `git sparse-checkout disable` (+ clear the legacy `core.sparseCheckout` config and `.git/info/sparse-checkout`), then re-checkout the tag to materialise the full tree. **Idempotent** — a no-op once expanded, and harmless if the checkout was never sparse. - Guard the pm2 call: if `ecosystem.config.js` is somehow still absent, fail with a **clear diagnostic** (and `sparse-checkout list`) instead of the cryptic `[PM2][ERROR]`. - README updated. ## To verify / re-deploy This only changes the workflow, so it needs a **fresh tag** to re-run: ``` git pull && git tag v0.3.1 && git push origin v0.3.1 ``` Watch run under **Actions**. On that run the step should now print `=== Building GstService ===` / `EpfoService` and bring them up under pm2 (`gst-service`:3003, `epfo-service`:3004), then health-check them. PdfService is still skipped until #101 merges. One independent caveat still stands from #102: if GstService/EpfoService were already running on pms1 under **different** pm2 names, delete those once (`pm2 delete <old> && pm2 save`) so the canonical names can bind their ports. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
shad0w added 1 commit 2026-06-23 21:43:17 +00:00
fix(deploy): expand sparse checkout so microservices/ecosystem are on disk
All checks were successful
PR checks / checks (pull_request) Successful in 43s
PR checks / integration (pull_request) Successful in 32s
cd2bcefdbd
Run #120 (v0.3.0 deploy) failed at the microservice step: every service folder
and ecosystem.config.js were "absent", and pm2 reported "File ecosystem.config.js
not found". Root cause: ~/pms on pms1 is a sparse checkout limited to App/, so
`git checkout -f $TAG` never materialised the service folders or the root
ecosystem.config.js. The app itself deployed fine (App/ is in the sparse set) and
prod stayed healthy.

- deploy.yml: before managing services, disable sparse-checkout (and clear the
  legacy core.sparseCheckout config + .git/info/sparse-checkout), then re-checkout
  the tag to materialise the full tree. Idempotent / no-op once expanded.
- Guard the pm2 call: if ecosystem.config.js is still absent, fail with a clear
  diagnostic (+ sparse-checkout list) instead of the cryptic PM2 error.
- README: note the sparse-checkout expansion.

Needs a fresh tag (e.g. v0.3.1) to re-run the deploy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shad0w merged commit cc7161d5ed into master 2026-06-23 21:43:43 +00:00
Sign in to join this conversation.
No description provided.