Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions _topic_maps/_topic_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Name: Work with Builds
Dir: work_with_builds
Distros: openshift-builds
Topics:
- Name: Running Builds
- Name: Managing Builds
File: using-builds
---
Name: Work with Shared Resources
Expand All @@ -83,8 +83,10 @@ Name: Observability
Dir: observability
Distros: openshift-builds
Topics:
- Name: Build controller observability
File: build-controller-observability
- Name: Logging
File: logging
- Name: Monitoring
File: monitoring
---
Name: Uninstall
Dir: uninstalling
Expand Down
45 changes: 43 additions & 2 deletions modules/ob-creating-a-build-with-oci-artifacts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,46 @@ EOF
<5> Optional: Replace `<secret-name-for-credentials>` with the secret name that stores the credentials for pushing container images. To generate a secret for a private registry for authentication, see link:https://docs.redhat.com/en/documentation/builds_for_red_hat_openshift/1.5/html-single/authentication/index#ob-authentication-to-container-registries_understanding-authentication-at-runtime[Authentication to container registries]

. Choose one of the following methods to upload your source code to the required registry and run the build:
.. Use the shp CLI
.. Manually upload the OCI artifact
* Use the `shp` CLI:

** Run the following command in the directory containing the local source code. It packages your source code into a scratch container image, pushes it to the required registry, and runs the build:
+
[source,terminal]
----
$ shp build upload my-oci-build # <1>
----
<1> Defines the name of the `Build` resource.

* Upload the OCI artifact manually:

.. Create a `Containerfile` in the root directory of your source code and add the following configuration:
+
[source,dockerfile]
----
FROM scratch
COPY . /
----

.. Run the following command in the root directory of your source code to build the container image using Podman:
+
[source,terminal]
----
$ podman build -t <registry-path>/<image-name>:<tag> # <1>
----
<1> Replace <registry-path>/<image-name>:<tag> with the build location for the container image.

.. Push the container image to the required location using the following command:
+
[source,terminal]
----
$ podman push <registry-path>/<image-name>:<tag> # <1>
----
<1> Replace <registry-path>/<image-name>:<tag> with the location where you want to push the built image.

.. Run the build using the following command:
+
[source,terminal]
----
$ shp build run my-oci-build # <1>
----
<1> Defines the name of the `Build` resource.
23 changes: 15 additions & 8 deletions modules/ob-creating-a-buildpacks-build.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[id="ob-creating-a-buildpacks-build_{context}"]
= Creating a buildpacks build

[role="_abstract"]
You can create a `buildpacks` build and push the created image to the target registry. The following types of `buildpacks` cluster build strategy are available for {builds-title}:

* `buildpacks` strategy
Expand Down Expand Up @@ -60,7 +61,8 @@ $ oc create rolebinding allow-builds-to-push \
----

. Create a `Build` resource and apply it to the {ocp-product-title} cluster by using one of the following CLIs:
.. Using `oc` CLI

* Using `oc` CLI
+
[source,terminal]
----
Expand Down Expand Up @@ -118,8 +120,9 @@ EOF
<5> Specifies the builder image used by Cloud Native Buildpacks (CNB) to detect and build your application.
<6> Specifies the subdirectory within your Git repository where the application source code is located.
<7> Specifies the location where the built image is pushed.

+
.. Using `shp` CLI:
* Using `shp` CLI:
+
[source,terminal]
----
Expand All @@ -138,21 +141,23 @@ $ shp build create buildpack-nodejs-build \
----

. Check if the `Build` resource was created by using one of the following CLIs:
.. Using `oc` CLI:
* Using `oc` CLI:
+
[source,terminal]
----
$ oc get builds.shipwright.io buildpack-nodejs-build
----
.. Using `shp` CLI:

* Using `shp` CLI:
+
[source,terminal]
----
$ shp build list
----

. Create a `BuildRun` resource and apply it to the {ocp-product-title} cluster by using one of the following CLIs:
.. Using `oc` CLI:

* Using `oc` CLI:
+
[source,terminal]
----
Expand All @@ -168,7 +173,8 @@ spec:
EOF
----
<1> Specifies the `buildpack-nodejs-build` resource that will be executed.
.. Using `shp` CLI:

* Using `shp` CLI:
+
[source,terminal]
----
Expand Down Expand Up @@ -197,13 +203,14 @@ $ shp buildrun logs buildpack-nodej-<buildrun_resource_name> --follow
====

. Check if the `BuildRun` resource was created by using one of the following CLIs:
.. Using `oc` CLI:
* Using `oc` CLI:
+
[source,terminal]
----
$ oc get buildrun buildpack-nodejs-buildrun
----
.. Using `shp` CLI:

* Using `shp` CLI:
+
[source,terminal]
----
Expand Down
31 changes: 31 additions & 0 deletions modules/ob-deleting-a-build-resource.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
:_mod-docs-content-type: PROCEDURE
[id="ob-deleting-a-build-resources_{context}"]
= Deleting a build resource

[role="_abstract"]
You can delete a `build` resource if it is not required in your project.

.Prerequisites

* You have installed the `oc` CLI.
* Optional: You have installed the shp CLI.

.Procedure

* Delete a `build` resource by using one of the following CLIs:

** Using `oc` CLI
+
[source,terminal]
----
$ oc delete builds <build_resource_name> # <1>
----
<1> Replace <build_resource_name> with the name of the `build` resource.

** Using `shp` CLI
+
[source,terminal]
----
$ shp build delete <build_resource_name> # <1>
----
<1> Replace <build_resource_name> with the name of the `build` resource.
31 changes: 31 additions & 0 deletions modules/ob-deleting-a-buildrun-resource.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
:_mod-docs-content-type: PROCEDURE
[id="ob-deleting-a-buildrun-resources_{context}"]
= Deleting a buildrun resource

[role="_abstract"]
You can delete a `buildrun` resource if it is not required in your project.

.Prerequisites

* You have installed the `oc` CLI.
* Optional: You have installed the shp CLI.

.Procedure

* Delete a `build` resource by using one of the following CLIs:

** Using `oc` CLI
+
[source,terminal]
----
$ oc delete buildrun <buildrun_resource_name> #<1>
----
<1> Replace <buildrun_resource_name> with the name of the `buildrun` resource.

** Using `shp` CLI
+
[source,terminal]
----
$ oc delete buildrun <buildrun_resource_name> # <1>
----
<1> Replace <buildrun_resource_name> with the name of the `buildrun` resource.
20 changes: 20 additions & 0 deletions modules/ob-deleting-a-buildstrategy-resource.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
:_mod-docs-content-type: PROCEDURE
[id="ob-deleting-a-buildstrategy-resources_{context}"]
= Deleting a buildstrategy resource

[role="_abstract"]
You can delete a `buildstrategy` resource if it is not required in your project.

.Prerequisites

* You have installed the `oc` CLI.

.Procedure

* Delete a `buildstrategy` resource by using the `oc` CLI:
+
[source,terminal]
----
$ oc delete buildstrategy <buildstartegy_resource_name> # <1>
----
<1> Replace <buildstartegy_resource_name> with the name of the `buildstrategy` resource.
74 changes: 0 additions & 74 deletions modules/ob-deleting-a-resource.adoc

This file was deleted.

6 changes: 6 additions & 0 deletions modules/ob-deleting-the-resources.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:_mod-docs-content-type: CONCEPT
[id="ob-deleting-the-resources_{context}"]
= Deleting the resources

You can delete resources created by the Buildah, Source-to-Image (S2I), and Buildpacks build processes using the oc CLI or the shp CLI. Deleting these resources helps you to
clean up build configurations that are no longer required in your project.
22 changes: 22 additions & 0 deletions modules/ob-editing-the-resources.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
:_mod-docs-content-type: PROCEDURE
[id="ob-editing-the-resources_{context}"]
= Editing the resources

[role="_abstract"]
You can edit the resources that are created by `buildah`, `source-to-image` and `buildpacks` build processes using the `oc` CLI. You can modify the resources as needed in your project.

.Prerequisites

* You have installed the `oc` CLI.

.Procedure

. Run the following command to open the YAML definition in the default editor:
+
[source,terminal]
----
$ oc edit <resource-name> <build_resource-name> # <1>
----
<1> Replace `<resource-name>` with the name of the resource (`build`, `buildrun` or `buildstrategy`) and `<build_resource-name>` with the name of the build resource that you want to edit.

. Edit the YAML definition and save the file.
18 changes: 0 additions & 18 deletions modules/ob-uploading-the-OCI-artifact-by-using-the-CLI.adoc

This file was deleted.

Loading