Laravel Forge JavaScript SDK

Deployment History

Deployment History

List deployments

Method

forge.deploymentHistory.list(server_id, site_id)

Usage

1const forge = new Forge('API_TOKEN');
2
3const deploymentHistory = await forge.deploymentHistory.list(
4 server_id,
5 site_id,
6);

Example Response

1{
2 "deployments": [
3 {
4 "id": 71,
5 "server_id": 196,
6 "site_id": 110,
7 "type": 4,
8 "commit_hash": "1aa50f0e4c49fed3a2335e866b03d4178ab93c4e",
9 "commit_author": "Dries Vints",
10 "commit_message": "Merge branch '8.x'\n\n# Conflicts:\n#\tCHANGELOG.md",
11 "started_at": "2020-11-05 12:56:05",
12 "ended_at": "2020-11-05 12:56:11",
13 "status": "failed",
14 "displayable_type": "Deployment API"
15 }
16 ]
17}

Get a deployment

Method

forge.deploymentHistory.get(server_id, site_id, deployment_id)

Usage

1const forge = new Forge('API_TOKEN');
2
3const deployment = await forge.deploymentHistory.get(
4 server_id,
5 site_id,
6 deployment_id,
7);

Example Response

1{
2 "deployment": {
3 "id": 71,
4 "server_id": 196,
5 "site_id": 110,
6 "type": 4,
7 "commit_hash": "1aa50f0e4c49fed3a2335e866b03d4178ab93c4e",
8 "commit_author": "Dries Vints",
9 "commit_message": "Merge branch '8.x'\n\n# Conflicts:\n#\tCHANGELOG.md",
10 "started_at": "2020-11-05 12:56:05",
11 "ended_at": "2020-11-05 12:56:11",
12 "status": "failed",
13 "displayable_type": "Deployment API"
14 }
15}

Get deployment output

Method

forge.deploymentHistory.output(server_id, site_id, deployment_id)

Usage

1const forge = new Forge('API_TOKEN');
2
3const deploymentOutput = await forge.deploymentHistory.output(
4 server_id,
5 site_id,
6 deployment_id,
7);

Example Response

1{
2 "output": "Thu 05 Nov 2020 12:42:30 PM UTC\nFrom github.com:laravel/laravel\n * branch..."
3}

Edit this page on GitHub