Services /
Update service build options
Required permission
Project > Services > General > Update
Path parameters
projectId
string requiredID of the projectserviceId
string requiredID of the service
Request body
- {object}Build from a Dockerfile
dockerfile
{object} requiredbuildEngine
stringBuild engine to use. Defaults to recommended build engine `buildkit`one ofbuildkit, kanikodockerFilePath
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-._]*$buildkit
{object}useCache
booleanUse persistent storage to cache build layers.cacheStorageSize
integerThe amount of persistent storage available to each build in MB.useInternalCache
booleanDEPRECATED: This field will be removed in the near future.internalCacheStorage
integerDEPRECATED: This field will be removed in the near future.prRestrictions
[array]An array of pull request build rules. Only supported for build services. Each commit belonging to a pull request on a branch that matches one of the provided build rules will be built automatically.- stringA pull request build rule. Can contain `*` as a wildcard to match multiple branch names. For example, `feature/*` will build all commits from pull requests from branches that start with `feature/`.pattern^[^?:@$~ [\]{}]*$
branchRestrictions
[array]An array of branch build rules. Only supported for build services. Each commit belonging to a branch that matches one of the provided build rules will be built automatically.- stringA branch build rule. Can contain `*` as a wildcard to match multiple branch names. For example, `feature/*` will build all commits from branches that start with `feature/`.pattern^[^?:@$~ [\]{}]*$
pathIgnoreRules
[array]An array of path ignore rules. A commit will only be built if a file has been changed that does not match any of the ignore rules. Path ignore rules follow `.gitignore` syntax.- stringA path ignore rule, following `.gitignore` syntax. For example, `*.md` will ignore all files ending with `.md`.max length260
isAllowList
booleanIf `true`, the functionality of `pathIgnoreRules` will be inverted. A commit will only be built if a file has been changed that matches one or more of the rules in `pathIgnoreRules`.ciIgnoreFlagsEnabled
booleanIf `true`, enables commit ignore flags. If a commit message contains one or more of the flags in `ciIgnoreFlags`, that commit will not be built.ciIgnoreFlags
[array]An array of commit ignore flags. If a commit message contains one or more of these flags, that commit will not be built. Defaults to `["[skip ci]", "[ci skip]", "[no ci]", "[skip nf]", "[nf skip]", "[northflank skip]", "[skip northflank]"]`- stringA commit ignore flag.max length72
dockerfileTarget
stringIf your Dockerfile contains multiple build stages, you can specify the target stage by entering its name here.dockerCredentials
[array]- stringThe ID of the docker credentials to use.pattern^[A-Za-z0-9-]+$
includeGitFolder
booleanInclude .git folder inside the build contextfullGitClone
booleanInclude the entire git history as part of the .git folder. Only relevant if "includeGitFolder" is set.enableGitLfs
booleanEnable Git LFS support for the buildstorage
{object}ephemeralStorage
{object}storageSize
integerEphemeral storage per build in MBone of16384, 32768, 65536, 131072, 262144, 524288min16384max65536
- {object}Build from a Buildpack
buildpack
{object} requiredbuilder
stringBuildpack stack to use. Defaults to recommended stack `HEROKU_24`.one ofHEROKU_24, HEROKU_22, HEROKU_22_CLASSIC, HEROKU_20, HEROKU_18, GOOGLE_22, GOOGLE_V1, CNB_ALPINE, CNB_BIONIC, PAKETO_JAMMY_TINY, PAKETO_JAMMY_BASE, PAKETO_JAMMY_FULL, PAKETO_TINY, PAKETO_BASE, PAKETO_FULLbuildpackLocators
[array]Array of custom buildpacks to use.- stringUrl or registry identifier of custom buildpack.
buildContext
stringThe working directory to build in.pattern^\/([a-zA-Z0-9-._]+\/)*[a-zA-Z0-9-._]*$useCache
booleanShould build dependencies be cached?pathIgnoreRules
[array]An array of path ignore rules. A commit will only be built if a file has been changed that does not match any of the ignore rules. Path ignore rules follow `.gitignore` syntax.- stringA path ignore rule, following `.gitignore` syntax. For example, `*.md` will ignore all files ending with `.md`.max length260
isAllowList
booleanIf `true`, the functionality of `pathIgnoreRules` will be inverted. A commit will only be built if a file has been changed that matches one or more of the rules in `pathIgnoreRules`.ciIgnoreFlagsEnabled
booleanIf `true`, enables commit ignore flags. If a commit message contains one or more of the flags in `ciIgnoreFlags`, that commit will not be built.ciIgnoreFlags
[array]An array of commit ignore flags. If a commit message contains one or more of these flags, that commit will not be built. Defaults to `["[skip ci]", "[ci skip]", "[no ci]", "[skip nf]", "[nf skip]", "[northflank skip]", "[skip northflank]"]`- stringA commit ignore flag.max length72
- {object}Don't modify build type settings
prRestrictions
[array]An array of pull request build rules. Only supported for build services. Each commit belonging to a pull request on a branch that matches one of the provided build rules will be built automatically.- stringA pull request build rule. Can contain `*` as a wildcard to match multiple branch names. For example, `feature/*` will build all commits from pull requests from branches that start with `feature/`.pattern^[^?:@$~ [\]{}]*$
branchRestrictions
[array]An array of branch build rules. Only supported for build services. Each commit belonging to a branch that matches one of the provided build rules will be built automatically.- stringA branch build rule. Can contain `*` as a wildcard to match multiple branch names. For example, `feature/*` will build all commits from branches that start with `feature/`.pattern^[^?:@$~ [\]{}]*$
pathIgnoreRules
[array]An array of path ignore rules. A commit will only be built if a file has been changed that does not match any of the ignore rules. Path ignore rules follow `.gitignore` syntax.- stringA path ignore rule, following `.gitignore` syntax. For example, `*.md` will ignore all files ending with `.md`.max length260
isAllowList
booleanIf `true`, the functionality of `pathIgnoreRules` will be inverted. A commit will only be built if a file has been changed that matches one or more of the rules in `pathIgnoreRules`.ciIgnoreFlagsEnabled
booleanIf `true`, enables commit ignore flags. If a commit message contains one or more of the flags in `ciIgnoreFlags`, that commit will not be built.ciIgnoreFlags
[array]An array of commit ignore flags. If a commit message contains one or more of these flags, that commit will not be built. Defaults to `["[skip ci]", "[ci skip]", "[no ci]", "[skip nf]", "[nf skip]", "[northflank skip]", "[skip northflank]"]`- stringA commit ignore flag.max length72
dockerfileTarget
stringIf your Dockerfile contains multiple build stages, you can specify the target stage by entering its name here.dockerCredentials
[array]- stringThe ID of the docker credentials to use.pattern^[A-Za-z0-9-]+$
includeGitFolder
booleanInclude .git folder inside the build contextfullGitClone
booleanInclude the entire git history as part of the .git folder. Only relevant if "includeGitFolder" is set.enableGitLfs
booleanEnable Git LFS support for the buildstorage
{object}ephemeralStorage
{object}storageSize
integerEphemeral storage per build in MBone of16384, 32768, 65536, 131072, 262144, 524288min16384max65536
Response body
- {object}Response object.
data
{object} requiredResult data.
POST /v1/projects/{projectId}/services/{serviceId}/build-options
Example request
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"dockerfile":{"buildEngine":"buildkit","dockerFilePath":"/Dockerfile","dockerWorkDir":"/"},"prRestrictions":["feature/*"],"branchRestrictions":["feature/*"],"pathIgnoreRules":["README.md"],"isAllowList":false,"ciIgnoreFlags":["[skip ci]"],"dockerCredentials":["example-docker-credential"],"storage":{"ephemeralStorage":{"storageSize":16384}}}' \
https://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/build-optionscurl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"buildpack":{"builder":"HEROKU_24","buildpackLocators":["https://buildpack-registry.heroku.com/cnb/mars/create-react-app"],"buildContext":"/","useCache":false},"pathIgnoreRules":["README.md"],"isAllowList":false,"ciIgnoreFlags":["[skip ci]"]}' \
https://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/build-optionscurl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"prRestrictions":["feature/*"],"branchRestrictions":["feature/*"],"pathIgnoreRules":["README.md"],"isAllowList":false,"ciIgnoreFlags":["[skip ci]"],"dockerCredentials":["example-docker-credential"],"storage":{"ephemeralStorage":{"storageSize":16384}}}' \
https://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/build-optionsExample response
200 OK
JSON
{
"data": {}
}