A lightweight (~400 LOC) server used to deploy a new version of the K-App.
PORT
: Server listening portTOKEN_HASH
: argon2 hash of a token
The server have only one endpoint at root:
POST webhhoks.example.com/
Content-Type: application/json
{
"action": "<action-name>",
"token": "<token>",
"param1": "value1",
...
}
Bellow are listed all actions available.
Deploy a new version to prod.
{
"action": "deploy-prod",
"token": "<token>",
"sha": "<commit-sha>"
}
Response: a reporter object.
Deploy a new version to staging.
{
"action": "deploy-staging",
"token": "<token>",
"sha": "<commit-sha>"
}
Response: a reporter object.
Follow advancement for a task.
{
"action": "follow-action",
"token": "<token>",
"id": "<reporter-uuid>"
}
Response: a reporter object.
Cancel a task.
{
"action": "cancel-action",
"token": "<token>",
"id": "<reporter-uuid>"
}
Response: a reporter object.
The reporter object allows you to have an idea how the deployment is going.
Fields:
id
: Generated uuidstate
: One of:ENQUEUED
: Task is enqueued but not startedRUNNING
: Task is runningCOMPLETED
: Task ended successfullyCANCELLING
: Task is currently cancelling (after a timeout or a cancel request)CANCELLED
: Task was cancelled successfullyFAILED_CANCELLING
: Task failed at cancelling
progress
: Progress status (between 0 and 100)startDate
: Date when task was setRUNNING
endDate
: Date when task wasCOMPLETED
orCANCELLING
Example:
{
"id": "4b9732ea-32b9-4614-af4a-7c0f2e7ef889",
"state": "RUNNING",
"progress": 60,
"startDate": "2019-04-27T13:10:56.883Z",
"endDate": null
}