Deployments
Deployments let the user schedule a job to deploy the contents of their workspace repository to their workspace in the Matatika cloud.
This can be done manually or via a GitHub Webhook which you can see how to set up in our Quick Start Guide: Workspace Deploy Hook
Requests
Deploy your workspace repository
POST
/api/workspaces/{workspaces-id}/deployments
Deploys the workspace {workspace-id}
.
Request
Example Snippets
- cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/5e5c9a60-1a49-4ba9-937e-9950ed1a01f5/deployments' -i -X POST \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json'
- Python (requests)
import requests
url = "https://catalog.matatika.com:443/api/workspaces/5e5c9a60-1a49-4ba9-937e-9950ed1a01f5/deployments"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("POST", url, headers=headers)
print(response.text.encode('utf8'))
Response
202 Accepted
Job with HAL links.
{
"id" : "7127b1d3-a114-4bec-b108-004f374f0b77",
"created" : "2023-03-23T21:48:40.816543",
"type" : "WORKSPACE_DEPLOY",
"status" : "QUEUED",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/jobs/7127b1d3-a114-4bec-b108-004f374f0b77"
},
"delete job" : {
"href" : "https://catalog.matatika.com/api/jobs/7127b1d3-a114-4bec-b108-004f374f0b77",
"type" : "DELETE"
},
"logs" : {
"href" : "https://catalog.matatika.com/api/jobs/7127b1d3-a114-4bec-b108-004f374f0b77/logs?sequence=0",
"type" : "GET"
},
"withdraw job" : {
"href" : "https://catalog.matatika.com/api/jobs/7127b1d3-a114-4bec-b108-004f374f0b77/stopped",
"type" : "PUT"
}
}
}
GitHub webhook workspace deployment
POST
/api/workspaces/{workspaces-id}/deployments/github-webhook
Receives POST
requests from GitHub and starts a workspace deploy job.
Request
Example Snippets
- cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/5e5c9a60-1a49-4ba9-937e-9950ed1a01f5/deployments/github-webhook' -i -X POST \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'X-Hub-Signature: sha1=a402fed34ffb92617f1c2e873b82c05507d4ee2f' \
-H 'Content-Type: application/json' \
-d '{ }'
- Python (requests)
import requests
url = "https://catalog.matatika.com:443/api/workspaces/5e5c9a60-1a49-4ba9-937e-9950ed1a01f5/deployments/github-webhook"
data = { }
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("POST", url, headers=headers, data=data)
print(response.text.encode('utf8'))
Response
202 Accepted
Job with HAL links.
{
"id" : "0707f6d1-1d2d-4359-82f3-19af73ed9482",
"created" : "2023-03-23T21:48:41.897714",
"type" : "WORKSPACE_DEPLOY",
"status" : "QUEUED",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/jobs/0707f6d1-1d2d-4359-82f3-19af73ed9482"
},
"delete job" : {
"href" : "https://catalog.matatika.com/api/jobs/0707f6d1-1d2d-4359-82f3-19af73ed9482",
"type" : "DELETE"
},
"logs" : {
"href" : "https://catalog.matatika.com/api/jobs/0707f6d1-1d2d-4359-82f3-19af73ed9482/logs?sequence=0",
"type" : "GET"
},
"withdraw job" : {
"href" : "https://catalog.matatika.com/api/jobs/0707f6d1-1d2d-4359-82f3-19af73ed9482/stopped",
"type" : "PUT"
}
}
}