Skip to content

recipes/adonisjs

View source on GitHub

typescript
import '@catapultjs/deploy/recipes/adonisjs'

This recipe runs the AdonisJS install, build, and migration steps on the server. It does not override deploy:update_code, so combine it with a transfer recipe such as git or rsync.

See the example AdonisJS project for a complete setup, or go directly to deploy.ts.

Tasks

TaskInsertedDescription
deploy:installafter deploy:update_codeUses the built-in install task in the release directory
deploy:buildafter deploy:sharedOverrides the built-in build task to run node ace build, copy package.json and the lock file into build/, and create build/tmp
ace:migration:runbefore deploy:publishRuns node ace migration:run --force
ace:migration:rollbackmanualRuns node ace migration:rollback
ace:migration:statusmanualRuns node ace migration:status
ace:list:routesmanualRuns node ace list:routes

The recipe runs commands from /.

Configuration

KeyTypeDefaultDescription
writable_dirsstring[]['storage', 'logs', 'tmp']Directories created in shared/ during cata deploy:setup
shared_dirsstring[]['storage', 'logs']Directories symlinked from shared/ into each release
shared_filesstring[]['.env']Files symlinked from shared/ into each release
adonisjs_pathstring''Sub-path to the AdonisJS app within the repository
typescript
import { set } from '@catapultjs/deploy'

set('adonisjs_path', 'apps/api')
set('shared_files', ['.env', '.env.production'])

import '@catapultjs/deploy/recipes/adonisjs'

If you want to build AdonisJS locally instead of on the server, follow the local deployment example.