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/52d79df5-c89f-4083-a586-430ae61ac3dd/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/52d79df5-c89f-4083-a586-430ae61ac3dd/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" : "39f5dcbb-23c7-4df1-a1af-680f4c00357b",
"created" : "2024-04-10T14:19:38.472959",
"type" : "WORKSPACE_DEPLOY",
"maxAttempts" : 0,
"attempt" : 0,
"status" : "QUEUED",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/jobs/39f5dcbb-23c7-4df1-a1af-680f4c00357b"
},
"delete job" : {
"href" : "https://catalog.matatika.com/api/jobs/39f5dcbb-23c7-4df1-a1af-680f4c00357b",
"type" : "DELETE"
},
"logs" : {
"href" : "https://catalog.matatika.com/api/jobs/39f5dcbb-23c7-4df1-a1af-680f4c00357b/logs?sequence=0",
"type" : "GET"
},
"withdraw job" : {
"href" : "https://catalog.matatika.com/api/jobs/39f5dcbb-23c7-4df1-a1af-680f4c00357b/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/52d79df5-c89f-4083-a586-430ae61ac3dd/deployments/github-webhook' -i -X POST \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'X-Hub-Signature: sha1=302e2d523f139171173129e64ab027478044cb02' \
-H 'Content-Type: application/json' \
-d '{ }'
Python (requests
)
import requests
url = "https://catalog.matatika.com:443/api/workspaces/52d79df5-c89f-4083-a586-430ae61ac3dd/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" : "83cd8e19-0aa9-4c69-97df-02a6f98e13ea",
"created" : "2024-04-10T14:19:39.093189",
"type" : "WORKSPACE_DEPLOY",
"maxAttempts" : 0,
"attempt" : 0,
"status" : "QUEUED",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/jobs/83cd8e19-0aa9-4c69-97df-02a6f98e13ea"
},
"delete job" : {
"href" : "https://catalog.matatika.com/api/jobs/83cd8e19-0aa9-4c69-97df-02a6f98e13ea",
"type" : "DELETE"
},
"logs" : {
"href" : "https://catalog.matatika.com/api/jobs/83cd8e19-0aa9-4c69-97df-02a6f98e13ea/logs?sequence=0",
"type" : "GET"
},
"withdraw job" : {
"href" : "https://catalog.matatika.com/api/jobs/83cd8e19-0aa9-4c69-97df-02a6f98e13ea/stopped",
"type" : "PUT"
}
}
}