Scroll to navigation

OC(1) June 2016 OC(1)

NAME

oc start-build - Start a new build

SYNOPSIS

oc start-build [OPTIONS]

DESCRIPTION

Start a build.

This command starts a new build for the provided build config or copies an existing build using --from-build=<name> . Pass the --follow flag to see output from the build.

In addition, you can pass a file, directory, or source code repository with the --from-file, --from-dir, or --from-repo flags directly to the build. The contents will be streamed to the build and override the current build source settings. When using --from-repo, the --commit flag can be used to control which branch, tag, or commit is sent to the server. If you pass --from-file, the file is placed in the root of an empty directory with the same filename. It is also possible to pass a http or https url to --from-file and --from-archive, however authentication is not supported and in case of https the certificate must be valid and recognized by your system.

Note that builds triggered from binary input will not preserve the source on the server, so rebuilds triggered by base image changes will use the source specified on the build config.

OPTIONS

--allow-missing-template-keys=true
If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.

--build-arg=[]
Specify a key-value pair to pass to Docker during the build.

--build-loglevel=""
Specify the log level for the build log output

--commit=""
Specify the source code commit identifier the build should use; requires a build based on a Git repository

-e, --env=[]
Specify a key-value pair for an environment variable to set for the build container.

--exclude="(^|/)\.git(/|$)"
When using the --from-dir option: regular expression for selecting files from the source tree to exclude from the build; the default excludes the '.git' directory (see ⟨https://golang.org/pkg/regexp⟩ for syntax, but note that "" will be interpreted as allow all files and exclude no files)

-F, --follow=false
Start a build and watch its logs until it completes or fails

--from-archive=""
An archive (tar, tar.gz, zip) to be extracted before the build and used as the binary input.

--from-build=""
Specify the name of a build which should be re-run

--from-dir=""
A directory to archive and use as the binary input for a build.

--from-file=""
A file to use as the binary input for the build; example a pom.xml or Dockerfile. Will be the only file in the build source.

--from-repo=""
The path to a local source code repository to use as the binary input for a build.

--from-webhook=""
Specify a generic webhook URL for an existing build config to trigger

--git-post-receive=""
The contents of the post-receive hook to trigger a build

--git-repository=""
The path to the git repository for post-receive; defaults to the current directory

--incremental=false
Overrides the incremental setting in a source-strategy build, ignored if not specified

--list-webhooks=""
List the webhooks for the specified build config or build; accepts 'all', 'generic', or 'github'

--no-cache=false
Overrides the noCache setting in a docker-strategy build, ignored if not specified

-o, --output=""
Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).

--show-managed-fields=false
If true, keep the managedFields when printing objects in JSON or YAML format.

--template=""
Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [ ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].

-w, --wait=false
Wait for a build to complete and exit with a non-zero return code if the build fails

OPTIONS INHERITED FROM PARENT COMMANDS

--as=""
Username to impersonate for the operation. User could be a regular user or a service account in a namespace.

--as-group=[]
Group to impersonate for the operation, this flag can be repeated to specify multiple groups.

--as-uid=""
UID to impersonate for the operation.

--cache-dir="/home/abuild/.kube/cache"
Default cache directory

--certificate-authority=""
Path to a cert file for the certificate authority

--client-certificate=""
Path to a client certificate file for TLS

--client-key=""
Path to a client key file for TLS

--cluster=""
The name of the kubeconfig cluster to use

--context=""
The name of the kubeconfig context to use

--disable-compression=false
If true, opt-out of response compression for all requests to the server

--insecure-skip-tls-verify=false
If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure

--kubeconfig=""
Path to the kubeconfig file to use for CLI requests.

--match-server-version=false
Require server version to match client version

-n, --namespace=""
If present, the namespace scope for this CLI request

--profile="none"
Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)

--profile-output="profile.pprof"
Name of the file to write the profile to

--request-timeout="0"
The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.

-s, --server=""
The address and port of the Kubernetes API server

--tls-server-name=""
Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used

--token=""
Bearer token for authentication to the API server

--user=""
The name of the kubeconfig user to use

--warnings-as-errors=false
Treat warnings received from the server as errors and exit with a non-zero exit code

EXAMPLE


# Starts build from build config "hello-world"
oc start-build hello-world

# Starts build from a previous build "hello-world-1"
oc start-build --from-build=hello-world-1

# Use the contents of a directory as build input
oc start-build hello-world --from-dir=src/

# Send the contents of a Git repository to the server from tag 'v2'
oc start-build hello-world --from-repo=../hello-world --commit=v2

# Start a new build for build config "hello-world" and watch the logs until the build
# completes or fails
oc start-build hello-world --follow

# Start a new build for build config "hello-world" and wait until the build completes. It
# exits with a non-zero return code if the build fails
oc start-build hello-world --wait

SEE ALSO

oc(1),

HISTORY

June 2016, Ported from the Kubernetes man-doc generator

Openshift CLI User Manuals Openshift