Link Search Menu Expand Document

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/api/workspaces/2d0acd90-ce3a-47d3-b3de-4683ed1d8871/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/api/workspaces/2d0acd90-ce3a-47d3-b3de-4683ed1d8871/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" : "3c8c6c99-1f40-4aea-9999-a6726471e535",
  "created" : "2022-11-04T15:18:40.156589",
  "type" : "WORKSPACE_DEPLOY",
  "status" : "QUEUED",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/jobs/3c8c6c99-1f40-4aea-9999-a6726471e535"
    },
    "delete job" : {
      "href" : "https://catalog.matatika.com/api/jobs/3c8c6c99-1f40-4aea-9999-a6726471e535",
      "type" : "DELETE"
    },
    "logs" : {
      "href" : "https://catalog.matatika.com/api/jobs/3c8c6c99-1f40-4aea-9999-a6726471e535/logs?sequence=0",
      "type" : "GET"
    },
    "withdraw job" : {
      "href" : "https://catalog.matatika.com/api/jobs/3c8c6c99-1f40-4aea-9999-a6726471e535/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/api/workspaces/2d0acd90-ce3a-47d3-b3de-4683ed1d8871/deployments/github-webhook' -i -X POST \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'X-Hub-Signature: sha1=18ecf7247cea0ad9cabcee7379c301bf68cc8bef' \
    -H 'Content-Type: application/json' \
    -d '{ }'
  • Python (requests)
import requests

url = "https://catalog.matatika.com/api/workspaces/2d0acd90-ce3a-47d3-b3de-4683ed1d8871/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" : "f21a67c0-b85d-4d87-a445-320f5073c84b",
  "created" : "2022-11-04T15:18:40.926175",
  "type" : "WORKSPACE_DEPLOY",
  "status" : "QUEUED",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/jobs/f21a67c0-b85d-4d87-a445-320f5073c84b"
    },
    "delete job" : {
      "href" : "https://catalog.matatika.com/api/jobs/f21a67c0-b85d-4d87-a445-320f5073c84b",
      "type" : "DELETE"
    },
    "logs" : {
      "href" : "https://catalog.matatika.com/api/jobs/f21a67c0-b85d-4d87-a445-320f5073c84b/logs?sequence=0",
      "type" : "GET"
    },
    "withdraw job" : {
      "href" : "https://catalog.matatika.com/api/jobs/f21a67c0-b85d-4d87-a445-320f5073c84b/stopped",
      "type" : "PUT"
    }
  }
}