# 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&#x20;
* /tmp/pids&#x20;
* /tmp/cache&#x20;
* /tmp/sockets&#x20;
* /vendor/bundle&#x20;
* /public/system&#x20;
* /public/uploads&#x20;
* /public/assets&#x20;
* /storage

## What user is the deploy run as?

The `deploy` user.
