Create a new config file deployment via API
This method will create a new config file deployment.
URL
/projects/<project>/deployments
Replace <project>
with the permalink
of the project.
HTTP Method
POST
Supported parameters
parent_identifier
: The UUID
of the server or server group to deploy to (required)
mode
: The deployment mode, can be queue
or preview
(required)
copy_config_files
: Must be set to true
in config file deployments (required)
config_files_deployment
: Set to true
if the deployment only uploads the project's config files. (required)
Example cURL request
curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user my_email@domain.com:my-api-key \
-d '{
"deployment":{
"parent_identifier": "68180695-e71f-4c09-afba-d0cc87b8e39b",
"mode": "queue",
"copy_config_files": true,
"config_files_deployment": true
}
}'
account.deployhq.com/projects/config_project/deployments
Example Response
{
"identifier": "a08d5111-ec1d-42a6-a74b-b7e45f92e9cf",
"servers": [
{
"id": 1519233,
"identifier": "68180695-e71f-4c09-afba-d0cc87b8e39b",
"name": "Server-endpoint",
"protocol_type": "ssh",
"server_path": "/home/ubuntu/www",
"last_revision": "0f236d2574dc55191b536264383495bb97d4e943",
"preferred_branch": "main",
"branch": "",
"notify_email": "",
"server_group_identifier": "72afe1be-359e-4aef-b851-a1107c162e2b",
"auto_deploy": false,
"environment": "",
"hostname": "54.135.219.121",
"username": "ubuntu",
"port": "22",
"use_ssh_keys": true,
"host_key": "[HOST_KEY]",
"unlink_before_upload": false
}
],
"project": {
[...]
},
"deployer": "Viktor",
"branch": null,
"start_revision": {
"ref": null
},
"end_revision": {
"ref": null
},
"status": "pending",
"timestamps": {
"queued_at": "2024-09-26T14:11:04.000+02:00",
"started_at": null,
"completed_at": null,
"duration": null,
"runs_at": "2024-09-26T14:11:04.000+02:00"
},
"files": {
"68180695-e71f-4c09-afba-d0cc87b8e39b": {
"changed": [],
"removed": []
}
},
"configuration": {
"copy_config_files": true,
"notification_addresses": null,
"skip_project_files": true
},
"legacy": false,
"deferred": false,
"config_files_deployment": true,
"steps": [
{
"step": "waiting_for_capacity",
"stage": "preparing",
"identifier": "7c32288f-6cd2-4894-8b38-e947acf5a8c8",
"server": null,
"total_items": null,
"completed_items": null,
"description": "Waiting for an available deployment slot",
"status": "running",
"logs": false,
"deployment_started_at": null,
"updated_at": "2024-09-26T14:11:04.000+02:00"
},
{
"step": "preflight_checks",
"stage": "preparing",
"identifier": "79c37a83-176f-409c-94f5-9db4e277ec30",
"server": null,
"total_items": 3,
"completed_items": null,
"description": "Performing pre-deployment checks",
"status": "pending",
"logs": false,
"deployment_started_at": null,
"updated_at": "2024-09-26T14:11:04.000+02:00"
},
{
"step": "transfer_files",
"stage": "transferring",
"identifier": "22f5f027-3cc8-492e-a99f-b5ff020823eb",
"server": 1519233,
"total_items": null,
"completed_items": null,
"description": "Transferring changed files",
"status": "pending",
"logs": false,
"deployment_started_at": null,
"updated_at": "2024-09-26T14:11:04.000+02:00"
},
{
"step": "upload_config_files",
"stage": "transferring",
"identifier": "449c5e61-c26b-4814-a595-7f054054faef",
"server": 1519233,
"total_items": 1,
"completed_items": null,
"description": "Uploading config files",
"status": "pending",
"logs": false,
"deployment_started_at": null,
"updated_at": "2024-09-26T14:11:04.000+02:00"
},
{
"step": "run_after_changes_command",
"stage": "transferring",
"identifier": "4feb784a-1f9e-4da6-879f-d96a2fe5251a",
"server": 1519233,
"total_items": null,
"completed_items": null,
"description": "Running SSH command test SSH command",
"status": "pending",
"logs": false,
"deployment_started_at": null,
"updated_at": "2024-09-26T14:11:04.000+02:00"
},
{
"step": "run_after_changes_command",
"stage": "transferring",
"identifier": "5c8e1979-2e82-4b2d-bfa8-e622da6080cd",
"server": 1519233,
"total_items": null,
"completed_items": null,
"description": "Running SSH command restart IIS",
"status": "pending",
"logs": false,
"deployment_started_at": null,
"updated_at": "2024-09-26T14:11:04.000+02:00"
},
{
"step": "send_webhooks",
"stage": "finishing",
"identifier": "0634844c-8067-4c7d-95ae-25f2087aa23b",
"server": null,
"total_items": 0,
"completed_items": null,
"description": "Delivering webhook notifications",
"status": "pending",
"logs": false,
"deployment_started_at": null,
"updated_at": "2024-09-26T14:11:04.000+02:00"
},
{
"step": "send_emails",
"stage": "finishing",
"identifier": "4b73503e-3968-4f7c-8c33-6e903024d764",
"server": null,
"total_items": null,
"completed_items": null,
"description": "Sending emails",
"status": "pending",
"logs": false,
"deployment_started_at": null,
"updated_at": "2024-09-26T14:11:04.000+02:00"
},
{
"step": "fix_versions",
"stage": "finishing",
"identifier": "24a1146a-fc3a-41e6-92a8-af883c25b729",
"server": null,
"total_items": null,
"completed_items": null,
"description": "Saving build environment",
"status": "pending",
"logs": false,
"deployment_started_at": null,
"updated_at": "2024-09-26T14:11:04.000+02:00"
}
]
}