Skip to content

Questions from first AdonisJS deploy with Catapult #1

@filipebraida

Description

@filipebraida

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).

  1. 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.

  1. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions