From PR #157 review:
Rather than hardcoding each service we could use the start npm script for each workspace in the apps directory like this: npm run start --workspace=apps/**. Then if we ever want to spin up another service it wouldn't need to be updated here.
This would require an update to the existing start scripts to add the timeout logic.
The current CI "Start services" step hardcodes each app:
node apps/auth/dist/app.js > /tmp/auth.log 2>&1 &
node apps/backend/dist/app.js > /tmp/backend.log 2>&1 &
timeout 30 bash -c 'until curl -sf http://localhost:8083/healthcheck ...'
timeout 30 bash -c 'until curl -sf http://localhost:8081/healthcheck ...'
To generalize this:
- Add a
start (or start:ci) script to each workspace under apps/ that starts the process, waits for the healthcheck, and backgrounds itself.
- Replace the hardcoded CI step with
npm run start --workspace=apps/** (or similar).
- Ensure the "Show service logs on failure" step still works with the new approach.
This way, adding a new service under apps/ requires no CI workflow changes.
Credit: @AyBruno
From PR #157 review:
The current CI "Start services" step hardcodes each app:
To generalize this:
start(orstart:ci) script to each workspace underapps/that starts the process, waits for the healthcheck, and backgrounds itself.npm run start --workspace=apps/**(or similar).This way, adding a new service under
apps/requires no CI workflow changes.Credit: @AyBruno