Available in Classic and VPC
Change the settings of a deployment project.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
PATCH | /api/v1/project/{projectId} |
Request headers
For information about the headers common to all SourceBuild APIs, see SourceBuild request headers.
Request parameters
Field | Type | Required | Description |
---|---|---|---|
projectId |
String | Required | Project ID
|
Request body
You can include the following data in the body of your request:
Field | Type | Required | Description |
---|---|---|---|
description |
String | Optional | Project description |
source |
Object | Optional | Source storage information |
source.type |
String | Optional | Source storage type
|
source.config |
Object | Conditional | Source storage repository information
|
source.config.repository |
String | Conditional | Source storage repository name |
source.config.branch |
String | Conditional | Source storage repository branch name |
env |
Object | Optional | Build environment information |
env.compute |
Object | Optional | Build environment computing type information |
env.compute.id |
Number | Optional | Computing type ID |
env.platform |
Object | Optional | Build environment platform information |
env.platform.type |
String | Optional | Image storage type
|
env.platform.config |
Object | Conditional | Build environment settings
|
env.platform.config.os |
Object | Conditional | Operating system information
|
env.platform.config.os.id |
Number | Conditional | Operating system ID |
env.platform.config.runtime |
Object | Conditional | Runtime information
|
env.platform.config.runtime.id |
Number | Conditional | Runtime type ID |
env.platform.config.runtime.version |
Object | Conditional | Runtime version information |
env.platform.config.runtime.version.id |
Number | Conditional | Runtime version ID |
env.platform.config.registry |
Object | Conditional | Registry information
|
env.platform.config.image |
String | Conditional | Image name
|
env.platform.config.tag |
String | Conditional | Image tag name
|
env.docker |
Object | Optional | Docker engine information |
env.docker.use |
Boolean | Optional | Inclusion status of Docker engine for Docker build
|
env.docker.id |
Number | Conditional | Docker engine version ID
|
env.timeout |
Number | Optional | Build execution timeout (minute)
|
env.envVars |
Array | Optional | Build environment variable information |
cmd |
Object | Optional | Build command information |
cmd.pre |
Array | Optional | Command before build |
cmd.build |
Array | Optional | Command during build |
cmd.post |
Array | Optional | Command after build |
cmd.dockerbuild |
Object | Conditional | Docker image build information
|
cmd.dockerbuild.use |
Boolean | Optional | Whether to use Docker image build settings
|
cmd.dockerbuild.dockerfile |
String | Conditional | dockerfile path |
cmd.dockerbuild.registry |
String | Conditional | Container Registry name |
cmd.dockerbuild.image |
String | Conditional | Image name |
cmd.dockerbuild.tag |
String | Conditional | Image tag name |
cmd.dockerbuild.latest |
Boolean | Optional | Whether to set latest tag
|
artifact |
Object | Conditional | Build result storage information
|
artifact.use |
Boolean | Optional | Whether to save build results
|
artifact.path |
Array | Conditional | Build result path
|
artifact.storage.bucket |
String | Conditional | Object Storage bucket name to store the results
|
artifact.storage.path |
String | Conditional | Object Storage bucket path to store the results
|
artifact.storage.filename |
String | Conditional | File name to store the results
|
artifact.backup |
Boolean | Optional | Whether to back up results
|
cache |
Object | Optional | Post-build image storage information
|
cache.use |
Boolean | Optional | Whether to store image after build completion
|
cache.registry |
String | Conditional | Container Registry name
|
cache.image |
String | Conditional | Image name
|
cache.tag |
String | Conditional | Image tag name
|
cache.latest |
Boolean | Optional | Whether to set latest tag
|
linked |
Object | Optional | Integrated service information |
linked.CloudLogAnalytics |
Boolean | Optional | Cloud Log Analytics integration
|
linked.FileSafer |
Boolean | Optional | File Safer integration
|
envVars
The following describes envVars
.
Field | Type | Required | Description |
---|---|---|---|
env.envVars.key |
String | Optional | Environment variable key |
env.envVars.value |
String | Optional | Environment variable value |
Request example
The request example is as follows:
curl --location --request PATCH 'https://sourcebuild.apigw.ntruss.com/api/v1/project/20***' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--data '{
"description": "Build001",
"source": {
"type": "SourceCommit",
"config": {
"repository": "repository001",
"branch": "master"
}
},
"env": {
"compute": {
"id": 1
},
"platform": {
"type": "SourceBuild",
"config": {
"os": {
"id": 1
},
"runtime": {
"id": 5,
"version": {
"id": 27
}
}
}
},
"docker": {
"use": true,
"id": 1
},
"timeout": 60,
"envVars": [
{
"key": "env1",
"value": "value1"
}
]
},
"cmd": {
"pre": [],
"build": [],
"post": [],
"dockerbuild": {
"use": false,
"dockerfile": "",
"registry": "",
"image": "",
"tag": "",
"latest": false
}
},
"artifact": {
"use": false,
"path": [],
"storage": {
"bucket": "string",
"path": "string",
"filename": "string"
},
"backup": false
},
"cache": {
"use": false,
"registry": "",
"image": "",
"tag": "",
"latest": false
},
"linked": {
"CloudLogAnalytics": false,
"FileSafer": false
}
}'
Response
This section describes the response format.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
result |
Object | - | Response result |
result.id |
Number | - | Project ID |
result.name |
String | - | Project name |
Response status codes
For information about the response status codes common to all SourceBuild APIs, see SourceBuild response status codes.
Response example
The response example is as follows:
{
"result": {
"id": 20***,
"name": "Build001"
}
}