Skip to content

Scripts

Run custom commands at different stages of the deploy lifecycle.

Script Types

Script When it runs Common use
release After dependencies install, before deploy Build assets, compile code
predeploy After release, before app starts Run migrations, seed data
postdeploy After app starts Warm caches, health checks
destroy When app is deleted Clean up external resources

Configuration

apps:
  - name: myapp
    scripts:
      release:
        - npm run build
        - npm run typecheck
      predeploy:
        - npm run migrate
      postdeploy:
        - echo "Deployed successfully"
      destroy:
        - echo "Cleaning up"

Examples

scripts:
  release:
    - npm ci
    - npm run build
  predeploy:
    - npx prisma migrate deploy
scripts:
  release:
    - pip install -r requirements.txt
  predeploy:
    - python manage.py migrate
    - python manage.py collectstatic --noinput
scripts:
  release:
    - go build -o server .
scripts:
  release:
    - npm run build
    - cp -r dist/* .

How They Work

  1. Dependencies install — Plitho runs npm install or pip install automatically
  2. release — Runs after dependencies are installed. Use for build steps.
  3. predeploy — Runs after release, before the app starts. The app is not running yet.
  4. postdeploy — Runs after the app starts. The app is live.
  5. destroy — Runs when the app is deleted.

Warning

Scripts run with the same permissions as your app. Don't put secrets in scripts — use environment variables instead.