LogoLogo
  • Hatchbox Classic Support
  • Clusters
  • Providers
  • Servers
  • Apps
    • ActionCable
    • Background Workers
    • Backups
    • BitBucket
    • Cron Jobs
    • Deploy Scripts
    • Domains & DNS
    • ElasticSearch
    • File Uploads
    • Image Processing
    • Jekyll
    • Passenger
    • Postgres
    • Puma
    • Rails
    • Rake
    • React On Rails
    • Ruby Versions
    • Sitemaps
    • Sphinx
    • SSL
    • Webhooks & Auto-Deploy
    • Webpacker
  • Security
  • Support
  • Databases
    • Backup & Restore
Powered by GitBook
On this page
  • What variables do I have access to in the deploy script?
  • How can I symlink another directory during deploy?
  • What directories are symlinked during the deploy automatically?
  • What user is the deploy run as?
  1. Apps

Deploy Scripts

What variables do I have access to in the deploy script?

We set a handful of variables you can use to add additional functionality to your deploy script:

  • $DIR - the app's main directory

  • $RELEASE - the timestamp of the new deploy

  • $BRANCH - the branch being deployed

  • $RELEASE_DIR - the directory of the current deployment

  • $WEB - boolean, true if running on a web server

  • $CRON - boolean, true if running on the cron server

  • $WORKER - boolean, true if running on a worker server

  • $REVISION - the git revision that's being deployed

  • $LOG_ID - the ID of the deployment log

How can I symlink another directory during deploy?

Add the following to your deploy script:

ln -s $DIR/shared/myfolder $RELEASE_DIR/myfolder

Keep in mind, you'll need to create myfolder on the server via SSH:

mkdir myapp/shared/myfolder

What directories are symlinked during the deploy automatically?

The following directories are automatically symlinked to the shared folder every deploy so that the contents are shared between releases.

  • /log

  • /tmp/pids

  • /tmp/cache

  • /tmp/sockets

  • /vendor/bundle

  • /public/system

  • /public/uploads

  • /public/assets

  • /storage

What user is the deploy run as?

The deploy user.

PreviousCron JobsNextDomains & DNS

Last updated 3 years ago