Required permission
Project > Jobs > Deployment > Deploy Build
Path parameters
projectId
string requiredID of the projectjobId
string requiredID of the job
Request body
- {object}Start a build with the current settings
sha
stringCommit sha to build. If not provided, will build the most recent commit of the job's branch.min length40max length40
- {object}Start a build with overrides for the current settings
sha
stringCommit sha to build. If not provided, will build the most recent commit of the job's branch.min length40max length40overrides
{object}An optional object that may specify several different overrides on the build level.buildArguments
{object}Build arguments that will be set on this build only. In case of conflicts these values take precedence.buildFiles
{object}Secret files as JSON object, encrypted at rest. File path must be absolutedockerSecretMounts
{object}Docker secret mount contents as JSON object, encrypted at rest. Must be a valid Docker secret mount identifierdocker
{object}Overrides for docker build settings.dockerFilePath
stringThe file path of the Dockerfile.pattern^\/([a-zA-Z0-9-._]+\/)*[a-zA-Z0-9-._]+$dockerWorkDir
stringThe working directory of the Dockerfile.pattern^\/([a-zA-Z0-9-._]+\/)*[a-zA-Z0-9-._]*$dockerfileTarget
stringIf your Dockerfile contains multiple build stages, you can specify the target stage by entering its name here.pattern^[a-zA-Z0-9-_]+$
Response body
- {object}Response object.
data
{object} requiredResult data.id
string requiredID of the build.branch
stringName of the branch the built commit belongs to.pullRequestId
number | nullID of the pull request the commit belongs to.sha
stringThe sha of the built commit.registry
{object}uri
stringURI of that can be used to pull the image from the registrycreatedAt
stringTimestamp of the build initiation.status
stringThe status of the build.concluded
booleanWhether the build has finished.
POST /v1/projects/{projectId}/jobs/{jobId}/build
POST /v1/teams/{teamId}/projects/{projectId}/jobs/{jobId}/build
Example request
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"sha":"262ed9817b3cad5142fbceabe0c9e371e390d616"}' \
https://api.northflank.com/v1/projects/{projectId}/jobs/{jobId}/buildcurl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"sha":"262ed9817b3cad5142fbceabe0c9e371e390d616","overrides":{"buildArguments":{"ARGUMENT_1":"abcdef","ARGUMENT_2":"12345"},"buildFiles":{"/dir/fileName":{"data":"VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=","encoding":"utf-8"}},"dockerSecretMounts":{"example-secret-mount_1":{"data":"VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=","encoding":"utf-8"}},"docker":{"dockerFilePath":"/Dockerfile","dockerWorkDir":"/"}}}' \
https://api.northflank.com/v1/projects/{projectId}/jobs/{jobId}/buildExample response
200 OK
JSON
{
"data": {
"id": "joyous-view-6290",
"branch": "main",
"sha": "12c15e7ee25fd78f567ebf87f9178b8ad70025b3",
"createdAt": "2021-07-28T15:55:38.296Z",
"status": "PENDING",
"concluded": false
}
}