# Envoyer - Projects/Deployment-Hooks

*Source: https://docs.envoyer.io/projects/deployment-hooks*

---

[Envoyer home page](https://envoyer.io)
Search...
⌘KAsk AI
- [email protected]
- [Platform Status](https://status.laravel.com/)
- [Dashboard](https://envoyer.io)
- [Dashboard](https://envoyer.io)
Search...
Navigation
Projects
Deployment Hooks
- [Documentation](/introduction)
##### Get Started
- [Introduction](/introduction)
- [Quick Start](/quick-start)
##### Accounts
- [Source Control](/accounts/source-control)
- [Your Account](/accounts/your-account)
##### Projects
- [Management](/projects/management)
- [Servers](/projects/servers)
- [Deployment Hooks](/projects/deployment-hooks)
- [Heartbeats](/projects/heartbeats)
- [Notifications](/projects/notifications)
- [Collaborators](/projects/collaborators)
## On this page
- [Overview](#overview)
- [Push To Deploy URL](#push-to-deploy-url)
  - [Deployment URL Options](#deployment-url-options)
- [Deployment Lifecycle](#deployment-lifecycle)
- [Hook Variables](#hook-variables)
Projects
# Deployment Hooks
Learn how to deploy your projects with Deployment Hooks.
> ## Documentation Index
>
> Fetch the complete documentation index at: <https://docs.envoyer.io/llms.txt>
>
> Use this file to discover all available pages before exploring further.
## [​](#overview) Overview
Deployment hooks allow you to customize your entire deployment plan by writing small Bash scripts to automate parts of your deployment. You may also specify the servers on which each hook is executed and the user that runs the hook.
Envoyer creates several first-party deployment hooks that cannot be modified or re-ordered:
- Clone New Release
- Install Composer Dependencies (if you have configured your project to do so)
- Activate New Release
- Purge Old Releases
Your custom hooks can be re-ordered before / after each of these fixed actions.
Like any other step during your deployment, if a deployment hook exits with a non-zero status code, the entire deployment will be cancelled. This prevents your application from experiencing downtime due to a broken deployment.
## [​](#push-to-deploy-url) Push To Deploy URL
If you need to trigger deployments as part of your CI or other automated process instead of [when code is pushed to your repository](/projects/management#source-control), you can choose to use the “Push To Deploy” URL that is generated by Envoyer for your project. To trigger a deployment using this URL, simply make an HTTP `GET` or `POST` request to the URL.
You may regenerate the “Push To Deploy” URL at any time by clicking the refresh icon next to the URL within the Deployment Hooks tab of your project.
### [​](#deployment-url-options) Deployment URL Options
You may pass either a `sha` or `branch` parameter to the deployment URL to choose which branch or Git commit to deploy. These parameters may be passed as query string variables or POST fields.
## [​](#deployment-lifecycle) Deployment Lifecycle
When a deployment is triggered for your project, Envoyer will execute your deployment plan. By default, this consists of downloading a tarball of your project, installing the Composer dependencies (if configured), pointing the `current` symbolic link at the latest release, and finally purging any old deployments from your server.
Of course, any deployment hooks you have configured will also be run during the deployment in their configured sequence.
## [​](#hook-variables) Hook Variables
Within your deployment hook scripts, you may use the `release` variable to access the most current release directory. For example:
```
cd {{ release }}

php artisan command
```
Other available variables are:
| Name | Description |
| --- | --- |
| `author` | The author of the commit that is being deployed |
| `branch` | The branch that Envoyer is configured to deploy |
| `message` | The message of the commit that is being deployed |
| `project` | The project’s root directory (the directory which contains `current`, `releases` and `storage`) |
| `release` | The current release path, within `releases` |
| `sha` | The commit hash that is being deployed |
| `time` | The current deployment formatted as `YmdHis` |
| `php` | The server’s configured PHP path |
| `composer` | The server’s configured Composer path |
| `name` | The project’s name |
Variables can be written with or without a space inside of the curly braces. For example, `{{ variable }}` is the same as `{{variable}}`
Was this page helpful?
YesNo
[Servers](/projects/servers)[Heartbeats](/projects/heartbeats)
⌘I
[Envoyer home page](https://envoyer.io)
Platform
[Dashboard](https://envoyer.io/)[Status](https://status.laravel.com/)
Legal and Compliance
[Term of Service](https://envoyer.io/terms)[Privacy Policy](https://envoyer.io/privacy)
Assistant
Responses are generated using AI and may contain mistakes.