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/26981984-75eb-4405-89e2-d4266f6602b5/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/26981984-75eb-4405-89e2-d4266f6602b5/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" : "0631c492-1199-4d83-8c27-94c52ce4b437",
"created" : "2024-05-11T08:35:11.64721",
"type" : "WORKSPACE_DEPLOY",
"maxAttempts" : 0,
"attempt" : 0,
"status" : "QUEUED",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/jobs/0631c492-1199-4d83-8c27-94c52ce4b437"
},
"delete job" : {
"href" : "https://catalog.matatika.com/api/jobs/0631c492-1199-4d83-8c27-94c52ce4b437",
"type" : "DELETE"
},
"logs" : {
"href" : "https://catalog.matatika.com/api/jobs/0631c492-1199-4d83-8c27-94c52ce4b437/logs?sequence=0",
"type" : "GET"
},
"withdraw job" : {
"href" : "https://catalog.matatika.com/api/jobs/0631c492-1199-4d83-8c27-94c52ce4b437/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/26981984-75eb-4405-89e2-d4266f6602b5/deployments/github-webhook' -i -X POST \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'X-Hub-Signature: sha1=c518dd59d227e2d42963b20052e17ec28ea8402c' \
-H 'Content-Type: application/json' \
-d '{ }'
Python (requests
)
import requests
url = "https://catalog.matatika.com:443/api/workspaces/26981984-75eb-4405-89e2-d4266f6602b5/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" : "b6b9d7f9-989c-4e1f-bde4-3e0c7f396fd3",
"created" : "2024-05-11T08:35:12.660342",
"type" : "WORKSPACE_DEPLOY",
"maxAttempts" : 0,
"attempt" : 0,
"status" : "QUEUED",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/jobs/b6b9d7f9-989c-4e1f-bde4-3e0c7f396fd3"
},
"delete job" : {
"href" : "https://catalog.matatika.com/api/jobs/b6b9d7f9-989c-4e1f-bde4-3e0c7f396fd3",
"type" : "DELETE"
},
"logs" : {
"href" : "https://catalog.matatika.com/api/jobs/b6b9d7f9-989c-4e1f-bde4-3e0c7f396fd3/logs?sequence=0",
"type" : "GET"
},
"withdraw job" : {
"href" : "https://catalog.matatika.com/api/jobs/b6b9d7f9-989c-4e1f-bde4-3e0c7f396fd3/stopped",
"type" : "PUT"
}
}
}