OC(1)

πŸ“¦
version 4.22.0 Β· 2 versions
, in nixpkgs unstable

πŸ’– NAME

oc start-build β€” start a new build, bestie ✨


✨ SYNOPSIS

oc start-build [OPTIONS]

🌸 DESCRIPTION

Okay so, this command starts a build. That's it. That's the vibe πŸŽ€

It starts a fresh new build for whatever build config you hand it, or, plot twist, it copies an existing build if you slide in --from-build=<name>. And if you want to actually watch the thing do its little thing, pass the --follow flag and you'll see the output from the build streaming at you live πŸ’…

Also, you can pass a file, a directory, or a whole source code repository straight into the build with the --from-file, --from-dir, or --from-repo flags. The contents get streamed to the build and override the current build source settings β€” like, fully take over. When you're using --from-repo, the --commit flag lets you control which branch, tag, or commit gets sent to the server. And if you pass --from-file, that file gets placed in the root of an empty directory with the same filename. ngl that's kind of iconic πŸ¦‹

You can also pass a http or https url to --from-file and --from-archive β€” but (and this is the important part, don't skip it) authentication is not supported, and for https the certificate must be valid and recognized by your system. No cap, don't come crying to me if your cert is expired 😭

Heads up: 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. Lowkey important. Remember it 🫢

πŸ’… OPTIONS

  • --allow-missing-template-keys β€” default 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 β€” default []. Specify a key-value pair to pass to Docker during the build.
  • --build-loglevel β€” default "". Specify the log level for the build log output.
  • --commit β€” default "". Specify the source code commit identifier the build should use; requires a build based on a Git repository.
  • -e, --env β€” default []. Specify a key-value pair for an environment variable to set for the build container.
  • --exclude β€” default (^|/)\.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). Yes, empty string means everything gets in, so be careful 🫣
  • -F, --follow β€” default false. Start a build and watch its logs until it completes or fails. Main character energy πŸ‘‘
  • --from-archive β€” default "". An archive (tar, tar.gz, zip) to be extracted before the build and used as the binary input.
  • --from-build β€” default "". Specify the name of a build which should be re-run.
  • --from-dir β€” default "". A directory to archive and use as the binary input for a build.
  • --from-file β€” default "". 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 β€” default "". The path to a local source code repository to use as the binary input for a build.
  • --from-webhook β€” default "". Specify a generic webhook URL for an existing build config to trigger.
  • --git-post-receive β€” default "". The contents of the post-receive hook to trigger a build.
  • --git-repository β€” default "". The path to the git repository for post-receive; defaults to the current directory.
  • --incremental β€” default false. Overrides the incremental setting in a source-strategy build, ignored if not specified.
  • --list-webhooks β€” default "". List the webhooks for the specified build config or build; accepts 'all', 'generic', or 'github'.
  • --no-cache β€” default false. Overrides the noCache setting in a docker-strategy build, ignored if not specified.
  • -o, --output β€” default "". Output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).
  • --show-managed-fields β€” default false. If true, keep the managedFields when printing objects in JSON or YAML format.
  • --template β€” default "". 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 β€” default false. Wait for a build to complete and exit with a non-zero return code if the build fails. Fr fr, it will exit non-zero if things go sideways πŸ’€

🫢 OPTIONS INHERITED FROM PARENT COMMANDS

These are the ones your oc parent command already had, and they got passed down like a family heirloom πŸ’œ

  • --as β€” default "". Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
  • --as-group β€” default []. Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
  • --as-uid β€” default "". UID to impersonate for the operation.
  • --as-user-extra β€” default []. User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key.
  • --cache-dir β€” default /homeless-shelter/.kube/cache. Default cache directory.
  • --certificate-authority β€” default "". Path to a cert file for the certificate authority.
  • --client-certificate β€” default "". Path to a client certificate file for TLS.
  • --client-key β€” default "". Path to a client key file for TLS.
  • --cluster β€” default "". The name of the kubeconfig cluster to use.
  • --context β€” default "". The name of the kubeconfig context to use.
  • --disable-compression β€” default false. If true, opt-out of response compression for all requests to the server.
  • --insecure-skip-tls-verify β€” default false. If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. ⚠️ Like, actually insecure. You've been warned.
  • --kubeconfig β€” default "". Path to the kubeconfig file to use for CLI requests.
  • --kuberc β€” default "". Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.
  • --match-server-version β€” default false. Require server version to match client version.
  • -n, --namespace β€” default "". If present, the namespace scope for this CLI request.
  • --profile β€” default none. Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex).
  • --profile-output β€” default profile.pprof. Name of the file to write the profile to.
  • --request-timeout β€” default 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 β€” default "". The address and port of the Kubernetes API server.
  • --tls-server-name β€” default "". Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used.
  • --token β€” default "". Bearer token for authentication to the API server.
  • --user β€” default "". The name of the kubeconfig user to use.
  • --warnings-as-errors β€” default false. Treat warnings received from the server as errors and exit with a non-zero exit code.

πŸ¦‹ EXAMPLE

Here's the part where it all clicks, bestie 🧚

# 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


⭐ HISTORY

June 2016, Ported from the Kubernetes man-doc generator.


Okay that's the whole page πŸŽ€ slay. Quick sign-off so you know where this came from: it's the Openshift CLI User Manuals version of this page (the Openshift source line at the bottom), from June 2016 β€” that's all the footer said, so that's all I'm giving you πŸ’– Bye bestie, go start some builds! πŸ¦‹

πŸ“¦ where this page comes from