Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 2. Understanding build configurations
The following sections define the concept of a build, build configuration, and outline the primary build strategies available.
2.1. BuildConfigs Link kopierenLink in die Zwischenablage kopiert!
A build configuration describes a single build definition and a set of triggers for when a new build is created. Build configurations are defined by a
BuildConfig
A build configuration, or
BuildConfig
Depending on how you choose to create your application using OpenShift Container Platform, a
BuildConfig
BuildConfig
The following example
BuildConfig
BuildConfig object definition
kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
name: "ruby-sample-build"
spec:
runPolicy: "Serial"
triggers:
-
type: "GitHub"
github:
secret: "secret101"
- type: "Generic"
generic:
secret: "secret101"
-
type: "ImageChange"
source:
git:
uri: "https://github.com/openshift/ruby-hello-world"
strategy:
sourceStrategy:
from:
kind: "ImageStreamTag"
name: "ruby-20-centos7:latest"
output:
to:
kind: "ImageStreamTag"
name: "origin-ruby-sample:latest"
postCommit:
script: "bundle exec rake test"
- 1
- This specification creates a new
BuildConfignamedruby-sample-build. - 2
- The
runPolicyfield controls whether builds created from this build configuration can be run simultaneously. The default value isSerial, which means new builds run sequentially, not simultaneously. - 3
- You can specify a list of triggers, which cause a new build to be created.
- 4
- The
sourcesection defines the source of the build. The source type determines the primary source of input, and can be eitherGit, to point to a code repository location,Dockerfile, to build from an inline Dockerfile, orBinary, to accept binary payloads. It is possible to have multiple sources at once. See the documentation for each source type for details. - 5
- The
strategysection describes the build strategy used to execute the build. You can specify aSource,Docker, orCustomstrategy here. This example uses theruby-20-centos7container image that Source-to-image (S2I) uses for the application build. - 6
- After the container image is successfully built, it is pushed into the repository described in the
outputsection. - 7
- The
postCommitsection defines an optional build hook.