Skip to content
Pre-release. HostCraft is in testing and not yet for sale. These docs describe the current build and may change. Join the waitlist to hear when it launches.

Git API

Source: daemon/proto/hostcraft/v1/git.proto

GitService manages Git repositories in account home directories and their deployments. REST: /api/v1/git. The push webhook endpoint (/api/v1/git/hooks/{id}) is authenticated by the repository's deploy token and stays REST only.

Method REST route Permission Streaming
ListRepos GET /api/v1/git/repos GitRepoRead unary
CreateRepo POST /api/v1/git/repos GitRepoCreate unary
ListImportCandidates GET /api/v1/git/import-candidates GitRepoCreate unary
GetRepo GET /api/v1/git/repos/{id} GitRepoRead unary
DeleteRepo DELETE /api/v1/git/repos/{id} GitRepoDelete unary
ListDeployments GET /api/v1/git/repos/{id}/deployments GitRepoRead unary
Pull POST /api/v1/git/repos/{id}/pull GitRepoUpdate unary
Checkout POST /api/v1/git/repos/{id}/checkout GitRepoUpdate unary
RotateDeployToken POST /api/v1/git/repos/{id}/rotate-token GitRepoUpdate unary
Deploy POST /api/v1/git/repos/{id}/deploy GitRepoDeploy unary

/hostcraft.v1.GitService/ListRepos

CreateRepo clones clone_url (or initialises an empty repository, or with import adopts an existing checkout at path).

/hostcraft.v1.GitService/CreateRepo

/hostcraft.v1.GitService/ListImportCandidates

/hostcraft.v1.GitService/GetRepo

/hostcraft.v1.GitService/DeleteRepo

/hostcraft.v1.GitService/ListDeployments

/hostcraft.v1.GitService/Pull

/hostcraft.v1.GitService/Checkout

/hostcraft.v1.GitService/RotateDeployToken

Deploy runs the repository's .hostcraft.yml (or .cpanel.yml) tasks.

/hostcraft.v1.GitService/Deploy

Field Type Number Description
id string 1 -
branch string 2 -
Field Type Number Description
account_id string 1 -
name string 2 -
path string 3 -
clone_url string 4 -
branch string 5 -
import bool 6 -
Field Type Number Description
repo GitRepo 1 -
workflow_id string 2 -
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
deployment GitDeployment 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
repo GitRepo 1 -
info GitInfo 2 -
info_error string 3 -
last_deployment GitDeployment 4 -
Field Type Number Description
id string 1 -
repo_id string 2 -
account_id string 3 -
trigger string 4 -
status string 5 running | succeeded | failed
commit string 6 -
log string 7 -
started_at google.protobuf.Timestamp 8 -
finished_at google.protobuf.Timestamp 9 -
Field Type Number Description
branch string 1 -
head_commit string 2 -
head_author string 3 -
head_date string 4 -
head_message string 5 -
clean bool 6 -
has_deploy_file bool 7 -
branches repeated string 8 -
remote string 9 -
Field Type Number Description
output string 1 -
Field Type Number Description
id string 1 -
account_id string 2 -
name string 3 -
path string 4 -
clone_url string 5 credentials redacted
webhook_path string 6 -
deploy_token string 7 callers with GitRepoDeploy only
created_at google.protobuf.Timestamp 8 -
updated_at google.protobuf.Timestamp 9 -
Field Type Number Description
path string 1 -
name string 2 -
remote string 3 -
Field Type Number Description
id string 1 -
Field Type Number Description
deployments repeated GitDeployment 1 -
Field Type Number Description
account_id string 1 -
Field Type Number Description
candidates repeated ImportCandidate 1 -
Field Type Number Description
account_id string 1 -
Field Type Number Description
repos repeated GitRepo 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -

WorkflowAccepted is the body of every 202 response that only starts a workflow saga. Follow progress with WorkflowService.StreamWorkflow.

Field Type Number Description
workflow_id string 1 -