Hi! First time using Catapult on an AdonisJS 7 + pnpm monorepo project. The tool worked great, got us from zero to a running deploy in a few iterations. Wanted to ask a few questions and share observations that might help other newcomers (or might just be my misunderstandings).
- Stale lock after interrupted deploy
If the local cata deploy is interrupted (Ctrl+C, network drop) between deploy:lock and deploy:unlock, the lock file remains on the host and the next cata deploy won't proceed.
I had to SSH in and remove the lock file manually.
- AdonisJS .env in production server vs in build/
The adonisjs recipe sets shared_files: ['.env'] and the deploy:shared task creates a symlink at release_path/<adonisjs_path>/.env.
That works for node ace migration:run (uses source ace.js which reads .env from apps//).
But the production HTTP server runs from build/bin/server.js. The compiled build/start/env.js calls:
Env.create(new URL('../', import.meta.url), {...})
From build/start/env.js, '../' resolves to build/. So AdonisJS reads .env from build/.env, which the recipe doesn't create.
Workaround I added in deploy.ts:
task('adonisjs:link-env', () => {
run('ln -sfn ../.env {{release_path}}/{{adonisjs_path}}/build/.env')
})
after('adonisjs:build', 'adonisjs:link-env')
Question: am I missing a recipe option? If not, would it make sense to bake this into the adonisjs recipe?
Thanks for the great tool!
Hi! First time using Catapult on an AdonisJS 7 + pnpm monorepo project. The tool worked great, got us from zero to a running deploy in a few iterations. Wanted to ask a few questions and share observations that might help other newcomers (or might just be my misunderstandings).
If the local cata deploy is interrupted (Ctrl+C, network drop) between deploy:lock and deploy:unlock, the lock file remains on the host and the next cata deploy won't proceed.
I had to SSH in and remove the lock file manually.
The adonisjs recipe sets shared_files: ['.env'] and the deploy:shared task creates a symlink at release_path/<adonisjs_path>/.env.
That works for node ace migration:run (uses source ace.js which reads .env from apps//).
But the production HTTP server runs from build/bin/server.js. The compiled build/start/env.js calls:
From build/start/env.js, '../' resolves to build/. So AdonisJS reads .env from build/.env, which the recipe doesn't create.
Workaround I added in deploy.ts:
Question: am I missing a recipe option? If not, would it make sense to bake this into the adonisjs recipe?
Thanks for the great tool!