Deploy Hooks API
Flightcontrol allows you to trigger deployments for any environment in your project using the Deploy Hooks API.
Using an HTTPS GET
request, you can start a deployment. The response returns the deployment's unique ID.
You can poll the deployment's status with the Get Deployment API.
Note: Deploy hooks will no longer build and deploy all services overriding watchPaths
. If you want to force deploying all your services overriding the watchPaths
settings then pass a force=true
query string parameter.
Normal Environments
- Go to the environment settings page by clicking
Edit Environment
- Locate the Deploy Hooks form, enter a name to remember it by, then click
Create Deploy Hook
To trigger a deployment with this hook, make an HTTPS GET
request to the generated url
Method | Path | Payload |
---|---|---|
GET | /api/deploy-hook/[envId]/[secret]?force=[force] | None |
Parameter Definitions
Parameter | Type | Description |
---|---|---|
envId | int | The unique ID for your environment. You can find it in the Flightcontrol Dashboard. |
secret | string | The secret key used to authenticate and identify the HTTP request. It will be generated for you when you create the hook. |
force | boolean | The flag to force deploy all services regardless of the watchPaths settings. |
Preview Environments
-
Go to the preview environment settings page by clicking
Edit Preview Environments
-
Locate the Deploy Hooks form, enter a name to remember it by, then click
Create Deploy Hook
To trigger a deployment with this hook, make an HTTPS GET
request to the generated url with these parameters
Method | Path | Payload |
---|---|---|
GET | /api/deploy-hook/[previewEnvId]/[secret]/[prNumber]/[commitSHA]?force=[force] | None |
All preview environments have the same deploy hook link. However, that link requires two additional parameters which are the prNumber
and commitSHA
.
Parameter Definitions
Parameter | Type | Description |
---|---|---|
previewEnvId | int | This is the unique ID for your preview environment. You can find it in the Flightcontrol Dashboard. |
secret | string | The secret key used to authenticate and identify the HTTP request. It will be generated for you when you create the hook. |
prNumber | int | The pull request number on Github, it is used to identify the correct environment that needs to be deployed. |
commitSHA | string | The git commit SHA to deploy. |
force | boolean | The flag to force deploy all services regardless of the watchPaths settings. |
Response Example
{
"success": "true",
"deploymentId": "clcpcxekt000lc9ojqtgtc26y"
}
Response Conditions
Success
Errors