Skip to content

Commit e93b7b7

Browse files
authored
Merge pull request #13106 from bmcelvee/basic-build
OSDOS-85 Basic builds
2 parents d170c13 + ac7e2fe commit e93b7b7

17 files changed

+361
-1
lines changed

_topic_map.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Topics:
3737
File: understanding-builds
3838
- Name: Creating build inputs
3939
File: creating-build-inputs
40+
- Name: Performing basic builds
41+
File: basic-build-operations
4042
---
4143
Name: OpenShift CCS modular docs guide
4244
Dir: mod_docs_guide
@@ -67,7 +69,7 @@ Topics:
6769
File: using-service-accounts-in-applications
6870
- Name: Using a service account as an OAuth client
6971
File: using-service-accounts-as-oauth-client
70-
- Name: Scoping tokens
72+
- Name: Scoping tokens
7173
File: tokens-scoping
7274
---
7375
Name: Users and roles

builds/basic-build-operations.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// This assembly is included in the following assemblies:
2+
// * assembly/builds
3+
4+
[id='basic-build-operations']
5+
= Performing basic builds
6+
include::modules/common-attributes.adoc[]
7+
:context: basic-build-operations
8+
toc::[]
9+
10+
The following sections provide instructions for basic build operations including
11+
starting and canceling builds, deleting BuildConfigs, viewing build details, and
12+
accessing build logs.
13+
14+
// The following include statements pull in the module files that comprise the assembly. Include any combination of concept, procedure, or reference modules required to cover the user story. You can also include other assemblies.
15+
16+
include::modules/builds-basic-start-build.adoc[leveloffset=+1]
17+
include::modules/builds-basic-start-re-run.adoc[leveloffset=+2]
18+
include::modules/builds-basic-start-logs.adoc[leveloffset=+2]
19+
include::modules/builds-basic-start-environment-variable.adoc[leveloffset=+2]
20+
include::modules/builds-basic-start-source.adoc[leveloffset=+2]
21+
include::modules/builds-basic-cancel-build.adoc[leveloffset=+1]
22+
include::modules/builds-basic-cancel-multiple.adoc[leveloffset=+2]
23+
include::modules/builds-basic-cancel-all.adoc[leveloffset=+2]
24+
include::modules/builds-basic-cancel-all-state.adoc[leveloffset=+2]
25+
include::modules/builds-basic-delete-buildconfig.adoc[leveloffset=+1]
26+
include::modules/builds-basic-view-build-details.adoc[leveloffset=+1]
27+
include::modules/builds-basic-access-build-logs.adoc[leveloffset=+1]
28+
include::modules/builds-basic-access-buildconfig-logs.adoc[leveloffset=+2]
29+
include::modules/builds-basic-access-buildconfig-version-logs.adoc[leveloffset=+2]
30+
include::modules/builds-basic-access-build-verbosity.adoc[leveloffset=+2]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Module included in the following assemblies:
2+
// * assembly/builds
3+
4+
[id='builds-basic-access-build-logs-{context}']
5+
= Accessing build logs
6+
7+
You can access build logs using the web console or the CLI.
8+
9+
.Procedure
10+
11+
To stream the logs using the build directly, run:
12+
13+
----
14+
$ oc describe build <build_name>
15+
----
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Module included in the following assemblies:
2+
// * assembly/builds
3+
4+
[id='builds-basic-access-build-verbosity-{context}']
5+
= Enabling log verbosity
6+
7+
You can enable a more verbose output by passing the `BUILD_LOGLEVEL` environment
8+
variable as part of the `sourceStrategy`
9+
ifdef::openshift-origin,openshift-enterprise,openshift-dedicated[]
10+
or `dockerStrategy`
11+
endif::[]
12+
in a `BuildConfig`.
13+
14+
[NOTE]
15+
====
16+
A platform administrator can set the default build verbosity for the entire
17+
{product-title} instance by configuring `env/BUILD_LOGLEVEL` for the
18+
`BuildDefaults` admission controller. This default can be overridden by
19+
specifying `BUILD_LOGLEVEL` in a given `BuildConfig`. You can specify a higher
20+
priority override on the command line for non-binary builds by passing
21+
`--build-loglevel` to `oc start-build`.
22+
====
23+
24+
25+
Available log levels for Source builds are as follows:
26+
27+
[horizontal]
28+
Level 0:: Produces output from containers running the *_assemble_* script and all encountered errors. This is the default.
29+
Level 1:: Produces basic information about the executed process.
30+
Level 2:: Produces very detailed information about the executed process.
31+
Level 3:: Produces very detailed information about the executed process, and a listing of the archive contents.
32+
Level 4:: Currently produces the same information as level 3.
33+
Level 5:: Produces everything mentioned on previous levels and additionally provides docker push messages.
34+
35+
.Procedure
36+
37+
To enable more verbose output, pass the `BUILD_LOGLEVEL` environment variable
38+
as part of the `sourceStrategy`
39+
ifndef::openshift-online[]
40+
or `dockerStrategy`
41+
endif::[]
42+
in a `BuildConfig`:
43+
44+
[source,yaml]
45+
----
46+
sourceStrategy:
47+
...
48+
env:
49+
- name: "BUILD_LOGLEVEL"
50+
value: "2" <1>
51+
----
52+
<1> Adjust this value to the desired log level.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Module included in the following assemblies:
2+
// * assembly/builds
3+
4+
[id='builds-basic-access-buildconfig-logs-{context}']
5+
= Accessing BuildConfig logs
6+
7+
You can access BuildConfig logs using the web console or the CLI.
8+
9+
.Procedure
10+
11+
To stream the logs of the latest build for a BuildConfig, run:
12+
13+
----
14+
$ oc logs -f bc/<buildconfig_name>
15+
----
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Module included in the following assemblies:
2+
// * assembly/builds
3+
4+
[id='builds-basic-access-buildconfig-version-logs-{context}']
5+
= Accessing BuildConfig logs for a given version build
6+
7+
You can access logs for a given version build for a BuildConfig using the web
8+
console or the CLI.
9+
10+
.Procedure
11+
12+
To stream the logs for a given version build for a BuildConfig, run:
13+
14+
----
15+
$ oc logs --version=<number> bc/<buildconfig_name>
16+
----
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Module included in the following assemblies:
2+
// * assembly/builds
3+
4+
[id='builds-basic-cancel-all-state-{context}']
5+
= Canceling all builds in a given state
6+
7+
You can cancel all builds in a given state (for example, *new* or *pending*),
8+
ignoring the builds in other states.
9+
10+
.Procedure
11+
12+
To cancel all in a given state, run:
13+
14+
----
15+
$ oc cancel-build bc/<buildconfig_name>
16+
----

modules/builds-basic-cancel-all.adoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Module included in the following assemblies:
2+
// * assembly/builds
3+
4+
[id='builds-basic-cancel-all-{context}']
5+
= Canceling all builds
6+
7+
You can cancel all builds from the build configuration with the following CLI
8+
command.
9+
10+
.Procedure
11+
12+
To cancel all builds, run:
13+
14+
----
15+
$ oc cancel-build bc/<buildconfig_name>
16+
----
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Module included in the following assemblies:
2+
// * assembly/builds
3+
4+
[id='builds-basic-cancel-build-{context}']
5+
= Canceling a build
6+
7+
You can cancel a build using the web console, or with the following CLI command.
8+
9+
.Procedure
10+
11+
To manually cancel a build, run:
12+
13+
----
14+
$ oc cancel-build <build_name>
15+
----
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Module included in the following assemblies:
2+
// * assembly/builds
3+
4+
[id='builds-basic-cancel-multiple-{context}']
5+
= Canceling multiple builds
6+
7+
You can cancel multiple builds with the following CLI command.
8+
9+
.Procedure
10+
11+
To manually cancel multiple builds, run:
12+
13+
----
14+
$ oc cancel-build <build1_name> <build2_name> <build3_name>
15+
----

0 commit comments

Comments
 (0)