Build encapsulates the inputs needed to produce a new deployable image, as well as the status of the execution and a reference to the Pod which executed the build.
Build encapsulates the inputs needed to produce a new deployable image, as well as the status of the execution and a reference to the Pod which executed the build.
object
Property | Type | Description |
---|---|---|
|
|
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
|
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
||
|
|
BuildSpec has the information to represent a build and also additional information about a build |
|
|
BuildStatus contains the status of a build |
BuildSpec has the information to represent a build and also additional information about a build
object
strategy
Property | Type | Description |
---|---|---|
|
|
completionDeadlineSeconds is an optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer |
|
|
mountTrustedCA bind mounts the cluster’s trusted certificate authorities, as defined in the cluster’s proxy configuration, into the build. This lets processes within a build trust components signed by custom PKI certificate authorities, such as private artifact repositories and HTTPS proxies. When this field is set to true, the contents of |
|
|
nodeSelector is a selector which must be true for the build pod to fit on a node If nil, it can be overridden by default build nodeselector values for the cluster. If set to an empty map or a map with any values, default build nodeselector values are ignored. |
|
|
BuildOutput is input to a build strategy and describes the container image that the strategy should produce. |
|
|
A BuildPostCommitSpec holds a build post commit hook specification. The hook executes a command in a temporary container running the build output image, immediately after the last layer of the image is committed and before the image is pushed to a registry. The command is executed with the current working directory ($PWD) set to the image’s WORKDIR. The build will be marked as failed if the hook execution fails. It will fail if the script or command return a non-zero exit code, or if there is any other error related to starting the temporary container. There are five different ways to configure the hook. As an example, all forms below are equivalent and will execute 1. Shell script: "postCommit": { "script": "rake test --verbose", } The above is a convenient form which is equivalent to: "postCommit": { "command": ["/bin/sh", "-ic"], "args": ["rake test --verbose"] } 2. A command as the image entrypoint: "postCommit": { "commit": ["rake", "test", "--verbose"] } Command overrides the image entrypoint in the exec form, as documented in Docker: https://docs.docker.com/engine/reference/builder/#entrypoint. 3. Pass arguments to the default entrypoint: "postCommit": { "args": ["rake", "test", "--verbose"] } This form is only useful if the image entrypoint can handle arguments. 4. Shell script with arguments: "postCommit": { "script": "rake test $1", "args": ["--verbose"] } This form is useful if you need to pass arguments that would otherwise be hard to quote properly in the shell script. In the script, $0 will be "/bin/sh" and $1, $2, etc, are the positional arguments from Args. 5. Command with arguments: "postCommit": { "command": ["rake", "test"], "args": ["--verbose"] } This form is equivalent to appending the arguments to the Command slice. It is invalid to provide both Script and Command simultaneously. If none of the fields are specified, the hook is not executed. |
|
resources computes resource requirements to execute the build. |
|
|
|
SourceRevision is the revision or commit information from the source for the build |
|
|
serviceAccount is the name of the ServiceAccount to use to run the pod created by this build. The pod will be allowed to use secrets referenced by the ServiceAccount |
|
|
BuildSource is the SCM used for the build. |
|
|
BuildStrategy contains the details of how to perform a build. |
|
|
triggeredBy describes which triggers started the most recent update to the build configuration and contains information about those triggers. |
|
|
BuildTriggerCause holds information about a triggered build. It is used for displaying build trigger data for each build and build configuration in oc describe. It is also used to describe which triggers led to the most recent update in the build configuration. |
BuildOutput is input to a build strategy and describes the container image that the strategy should produce.
object
Property | Type | Description |
---|---|---|
|
|
imageLabels define a list of labels that are applied to the resulting image. If there are multiple labels with the same name then the last one in the list is used. |
|
|
ImageLabel represents a label applied to the resulting image. |
|
PushSecret is the name of a Secret that would be used for setting up the authentication for executing the Docker push to authentication enabled Docker Registry (or Docker Hub). |
|
|
to defines an optional location to push the output of this build to. Kind must be one of 'ImageStreamTag' or 'DockerImage'. This value will be used to look up a container image repository to push to. In the case of an ImageStreamTag, the ImageStreamTag will be looked for in the namespace of the build unless Namespace is specified. |
imageLabels define a list of labels that are applied to the resulting image. If there are multiple labels with the same name then the last one in the list is used.
array
ImageLabel represents a label applied to the resulting image.
object
name
Property | Type | Description |
---|---|---|
|
|
name defines the name of the label. It must have non-zero length. |
|
|
value defines the literal value of the label. |
A BuildPostCommitSpec holds a build post commit hook specification. The hook executes a command in a temporary container running the build output image, immediately after the last layer of the image is committed and before the image is pushed to a registry. The command is executed with the current working directory ($PWD) set to the image’s WORKDIR.
The build will be marked as failed if the hook execution fails. It will fail if the script or command return a non-zero exit code, or if there is any other error related to starting the temporary container.
There are five different ways to configure the hook. As an example, all forms below are equivalent and will execute rake test --verbose
.
Shell script:
"postCommit": { "script": "rake test --verbose", }
The above is a convenient form which is equivalent to:
"postCommit": { "command": ["/bin/sh", "-ic"], "args": ["rake test --verbose"] }
A command as the image entrypoint:
"postCommit": { "commit": ["rake", "test", "--verbose"] }
Command overrides the image entrypoint in the exec form, as documented in Docker: https://docs.docker.com/engine/reference/builder/#entrypoint.
Pass arguments to the default entrypoint:
"postCommit": { "args": ["rake", "test", "--verbose"] }
This form is only useful if the image entrypoint can handle arguments.
Shell script with arguments:
"postCommit": { "script": "rake test $1", "args": ["--verbose"] }
This form is useful if you need to pass arguments that would otherwise be hard to quote properly in the shell script. In the script, $0 will be "/bin/sh" and $1, $2, etc, are the positional arguments from Args.
Command with arguments:
"postCommit": { "command": ["rake", "test"], "args": ["--verbose"] }
This form is equivalent to appending the arguments to the Command slice.
It is invalid to provide both Script and Command simultaneously. If none of the fields are specified, the hook is not executed.
object
Property | Type | Description |
---|---|---|
|
|
args is a list of arguments that are provided to either Command, Script or the container image’s default entrypoint. The arguments are placed immediately after the command to be run. |
|
|
command is the command to run. It may not be specified with Script. This might be needed if the image doesn’t have |
|
|
script is a shell script to be run with |
SourceRevision is the revision or commit information from the source for the build
object
type
Property | Type | Description |
---|---|---|
|
|
GitSourceRevision is the commit information from a git source for a build |
|
|
type of the build source, may be one of 'Source', 'Dockerfile', 'Binary', or 'Images' |
GitSourceRevision is the commit information from a git source for a build
object
Property | Type | Description |
---|---|---|
|
|
SourceControlUser defines the identity of a user of source control |
|
|
commit is the commit hash identifying a specific commit |
|
|
SourceControlUser defines the identity of a user of source control |
|
|
message is the description of a specific commit |
SourceControlUser defines the identity of a user of source control
object
Property | Type | Description |
---|---|---|
|
|
email of the source control user |
|
|
name of the source control user |
SourceControlUser defines the identity of a user of source control
object
Property | Type | Description |
---|---|---|
|
|
email of the source control user |
|
|
name of the source control user |
BuildSource is the SCM used for the build.
object
Property | Type | Description |
---|---|---|
|
|
BinaryBuildSource describes a binary file to be used for the Docker and Source build strategies, where the file will be extracted and used as the build source. |
|
|
configMaps represents a list of configMaps and their destinations that will be used for the build. |
|
|
ConfigMapBuildSource describes a configmap and its destination directory that will be used only at the build time. The content of the configmap referenced here will be copied into the destination directory instead of mounting. |
|
|
contextDir specifies the sub-directory where the source code for the application exists. This allows to have buildable sources in directory other than root of repository. |
|
|
dockerfile is the raw contents of a Dockerfile which should be built. When this option is specified, the FROM may be modified based on your strategy base image and additional ENV stanzas from your strategy environment will be added after the FROM, but before the rest of your Dockerfile stanzas. The Dockerfile source type may be used with other options like git - in those cases the Git repo will have any innate Dockerfile replaced in the context dir. |
|
|
GitBuildSource defines the parameters of a Git SCM |
|
|
images describes a set of images to be used to provide source for the build |
|
|
ImageSource is used to describe build source that will be extracted from an image or used during a multi stage build. A reference of type ImageStreamTag, ImageStreamImage or DockerImage may be used. A pull secret can be specified to pull the image from an external registry or override the default service account secret if pulling from the internal registry. Image sources can either be used to extract content from an image and place it into the build context along with the repository source, or used directly during a multi-stage container image build to allow content to be copied without overwriting the contents of the repository source (see the 'paths' and 'as' fields). |
|
|
secrets represents a list of secrets and their destinations that will be used only for the build. |
|
|
SecretBuildSource describes a secret and its destination directory that will be used only at the build time. The content of the secret referenced here will be copied into the destination directory instead of mounting. |
|
sourceSecret is the name of a Secret that would be used for setting up the authentication for cloning private repository. The secret contains valid credentials for remote repository, where the data’s key represent the authentication method to be used and value is the base64 encoded credentials. Supported auth methods are: ssh-privatekey. |
|
|
|
type of build input to accept |
BinaryBuildSource describes a binary file to be used for the Docker and Source build strategies, where the file will be extracted and used as the build source.
object
Property | Type | Description |
---|---|---|
|
|
asFile indicates that the provided binary input should be considered a single file within the build input. For example, specifying "webapp.war" would place the provided binary as |
configMaps represents a list of configMaps and their destinations that will be used for the build.
array
ConfigMapBuildSource describes a configmap and its destination directory that will be used only at the build time. The content of the configmap referenced here will be copied into the destination directory instead of mounting.
object
configMap
Property | Type | Description |
---|---|---|
|
configMap is a reference to an existing configmap that you want to use in your build. |
|
|
|
destinationDir is the directory where the files from the configmap should be available for the build time. For the Source build strategy, these will be injected into a container where the assemble script runs. For the container image build strategy, these will be copied into the build directory, where the Dockerfile is located, so users can ADD or COPY them during container image build. |
GitBuildSource defines the parameters of a Git SCM
object
uri
Property | Type | Description |
---|---|---|
|
|
httpProxy is a proxy used to reach the git repository over http |
|
|
httpsProxy is a proxy used to reach the git repository over https |
|
|
noProxy is the list of domains for which the proxy should not be used |
|
|
ref is the branch/tag/ref to build. |
|
|
uri points to the source that will be built. The structure of the source will depend on the type of build to run |
images describes a set of images to be used to provide source for the build
array
ImageSource is used to describe build source that will be extracted from an image or used during a multi stage build. A reference of type ImageStreamTag, ImageStreamImage or DockerImage may be used. A pull secret can be specified to pull the image from an external registry or override the default service account secret if pulling from the internal registry. Image sources can either be used to extract content from an image and place it into the build context along with the repository source, or used directly during a multi-stage container image build to allow content to be copied without overwriting the contents of the repository source (see the 'paths' and 'as' fields).
object
from
Property | Type | Description |
---|---|---|
|
|
A list of image names that this source will be used in place of during a multi-stage container image build. For instance, a Dockerfile that uses "COPY --from=nginx:latest" will first check for an image source that has "nginx:latest" in this field before attempting to pull directly. If the Dockerfile does not reference an image source it is ignored. This field and paths may both be set, in which case the contents will be used twice. |
|