List deployments history on a site.
GET /api/site/{id}/deployments
Example request :
curl "https://cloud.boxydev.com/api/site/1/deployments" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Example response :
{
"data": [
{
"id": 1,
"type": "manual",
"branch": "main",
"commit": {
"hash": "1234",
"author": "Matthieu Mota",
"avatar": "https://avatars.githubusercontent.com/u/2427947?v=4",
"message": "Commit",
"url": "https://github.com/vendor/repository/commit/1234"
},
"output": "From github.com:vendor/repository\n * branch main -> FETCH_HEAD\nAlready up to date.",
"status": "finished",
"site_id": 1,
"started_at": "2022-09-09T19:58:12.000000Z",
"ended_at": "2022-09-09T19:58:31.000000Z"
}
],
"links": {
"first": "https://cloud.boxydev.com/api/site/1/deployments?page=1",
"last": "https://cloud.boxydev.com/api/site/1/deployments?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://cloud.boxydev.com/api/site/1/deployments",
"per_page": 20,
"to": 1,
"total": 1
}
}
Show a deployment.
GET /api/deployment/{id}
Example request :
curl "https://cloud.boxydev.com/api/deployment/1" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Example response :
{
"id": 1,
"type": "manual",
"branch": "main",
"commit": {
"hash": "1234",
"author": "Matthieu Mota",
"avatar": "https://avatars.githubusercontent.com/u/2427947?v=4",
"message": "Commit",
"url": "https://github.com/vendor/repository/commit/1234"
},
"output": "From github.com:vendor/repository\n * branch main -> FETCH_HEAD\nAlready up to date.",
"status": "finished",
"site_id": 1,
"started_at": "2022-09-09T19:58:12.000000Z",
"ended_at": "2022-09-09T19:58:31.000000Z"
}
POST /api/site/{id}/deployment
Parameters :
Parameter | Description |
---|---|
branch | If you want to deploy a custom branch (only atomic site). |
hash | If you want to deploy a custom commit (only atomic site). |
Example request :
curl -X POST "https://cloud.boxydev.com/api/site/1/deployment" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"branch": "master"
}'
Example response :
{
"id": 1,
"domain": "website.com",
"test_domain": null,
"wildcard": false,
"aliases": null,
"directory": "/www",
"published": false,
"user": "cloud",
"status": "installed",
"type": "laravel",
"application": null,
"repository": {
"name": "vendor/project",
"branch": "master",
"status": "installed"
},
"deployment_script": null,
"build_script": null,
"activate_script": null,
"atomic": true,
"php_version": "8.1",
"server_id": 1,
"created_at": "2022-08-17T18:10:37.000000Z",
"secure": false,
"hook_url": "...",
"last_deployment": {
"id": 1,
"type": "manual",
"branch": "main",
"commit": {
"hash": "1234",
"author": "Matthieu Mota",
"avatar": "https://avatars.githubusercontent.com/u/2427947?v=4",
"message": "Commit",
"url": "https://github.com/vendor/repository/commit/1234"
},
"output": "From github.com:vendor/repository\n * branch main -> FETCH_HEAD\nAlready up to date.",
"status": "finished",
"site_id": 1,
"started_at": "2022-09-09T19:58:12.000000Z",
"ended_at": "2022-09-09T19:58:31.000000Z"
},
"balancing_method": null,
"tags": []
}
Show deployment log.
GET /api/deployment/{id}/log
Example request :
curl "https://cloud.boxydev.com/api/deployment/1/log" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Example response :
{
"output": "output\n",
"finished": true
}
Update a deployment script.
PUT /api/site/{id}/deployment/script
Parameters :
Parameter | Description |
---|---|
deployment_script | The deployment script. |
build_script | The build script (if atomic). |
activate_script | The activate script (if atomic). |
Example request :
curl -X PUT "https://cloud.boxydev.com/api/site/1/deployment/script" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"deployment_script": "git pull",
"build_script": "build",
"activate_script": "activate"
}'
Example response :
{
"id": 1,
"domain": "website.com",
"test_domain": null,
"wildcard": false,
"aliases": null,
"directory": "/www",
"published": false,
"user": "cloud",
"status": "installed",
"type": "laravel",
"application": null,
"repository": {
"name": "vendor/project",
"branch": "master",
"status": "installed"
},
"deployment_script": "git pull",
"build_script": "build",
"activate_script": "activate",
"atomic": true,
"php_version": "8.1",
"server_id": 1,
"created_at": "2022-08-17T18:10:37.000000Z",
"secure": false,
"hook_url": "...",
"last_deployment": {
"id": 1,
"type": "manual",
"branch": "main",
"commit": {
"hash": "1234",
"author": "Matthieu Mota",
"avatar": "https://avatars.githubusercontent.com/u/2427947?v=4",
"message": "Commit",
"url": "https://github.com/vendor/repository/commit/1234"
},
"output": "From github.com:vendor/repository\n * branch main -> FETCH_HEAD\nAlready up to date.",
"status": "finished",
"site_id": 1,
"started_at": "2022-09-09T19:58:12.000000Z",
"ended_at": "2022-09-09T19:58:31.000000Z"
},
"balancing_method": null,
"tags": []
}
Cancel a deployment.
DELETE /api/site/{id}/deployment
Example request :
curl -X DELETE "https://cloud.boxydev.com/api/site/1/deployment" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Rollback a deployment
POST /api/deployment/{id}/rollback
Example request :
curl -X POST "https://cloud.boxydev.com/api/deployment/1/rollback" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Example response :
{
"id": 1,
"domain": "website.com",
"test_domain": null,
"wildcard": false,
"aliases": null,
"directory": "/www",
"published": false,
"user": "cloud",
"status": "installed",
"type": "laravel",
"application": null,
"repository": {
"name": "vendor/project",
"branch": "master",
"status": "installed"
},
"deployment_script": null,
"build_script": null,
"activate_script": null,
"atomic": true,
"php_version": "8.1",
"server_id": 1,
"created_at": "2022-08-17T18:10:37.000000Z",
"secure": false,
"hook_url": "...",
"last_deployment": {
"id": 1,
"type": "manual",
"branch": "main",
"commit": {
"hash": "1234",
"author": "Matthieu Mota",
"avatar": "https://avatars.githubusercontent.com/u/2427947?v=4",
"message": "Commit",
"url": "https://github.com/vendor/repository/commit/1234"
},
"output": "From github.com:vendor/repository\n * branch main -> FETCH_HEAD\nAlready up to date.",
"status": "finished",
"site_id": 1,
"started_at": "2022-09-09T19:58:12.000000Z",
"ended_at": "2022-09-09T19:58:31.000000Z"
},
"balancing_method": null,
"tags": []
}
Publish deployment hook to provider.
PUT /api/site/{id}/publish
Example request :
curl -X PUT "https://cloud.boxydev.com/api/site/1/publish" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Unpublish deployment hook from provider.
DELETE /api/site/{id}/unpublish
Example request :
curl -X DELETE "https://cloud.boxydev.com/api/site/1/unpublish" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"