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
6 changes: 2 additions & 4 deletions about/build-strategies.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ You can use a curated set of build strategies or cluster build strategies on the
* `buildah`: Supported on all platforms
* `source-to-image`: Supported on the linux/amd64 platform

[NOTE]
====
The `buildpacks` build strategy is currently in link:https://access.redhat.com/support/offerings/devpreview[Developer Preview]. For more information, see the link:https://github.com/redhat-developer/openshift-builds-catalog/blob/main/clusterBuildStrategy/buildpacks/README.md[buildpacks example].
====
:FeatureName: The `buildpacks` build strategy
include::snippets/technology-preview.adoc[]

include::modules/ob-about-buildah.adoc[leveloffset=+1]

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.
63 changes: 34 additions & 29 deletions modules/ob-creating-a-buildpacks-build.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
[id="ob-creating-a-buildpacks-build_{context}"]
= Creating a buildpacks build

Learn how to create a buildpacks build and push the created image into the target registry.
There are two buildpacks `ClusterBuildStrategy` options available for {builds-title}:
[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
* `buildpacks-extender` strategy
Expand All @@ -13,12 +13,8 @@ There are two buildpacks `ClusterBuildStrategy` options available for {builds-ti
The `buildpacks-extender` strategy is compatible with the experimental buildpacks `extender` lifecycle phase. You can use this strategy, for example, for builds based on Node.js. However, the `extender` phase does not support Quarkus, or any other Java-based builds. For such builds, you use the `buildpacks` strategy instead.
====

[IMPORTANT]
====
Buildpacks is a Technology Preview feature only. Technology Preview features are not supported with Red{nbsp}Hat production service level agreements (SLAs) and might not be functionally complete. Red{nbsp}Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red{nbsp}Hat Technology Preview features, see link:https://access.redhat.com/support/offerings/techpreview/[Technology Preview Features Support Scope].
====
:FeatureName: The `buildpacks` build strategy
include::snippets/technology-preview.adoc[]

.Prerequisites

Expand Down Expand Up @@ -64,8 +60,10 @@ $ oc create rolebinding allow-builds-to-push \

--namespace=buildpacks-example
----
. Create a `Build` resource and apply it to the {ocp-product-title} cluster:
.. Using `oc` CLI

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

* Using `oc` CLI
+
[source,terminal]
----
Expand Down Expand Up @@ -116,15 +114,16 @@ spec:
image: image-registry.openshift-image-registry.svc:5000/buildpacks-example/taxi-app
EOF
----
<1> The Git repository containing your application source code.
<2> The build strategy to build the container.
<3> Parameters set for the buildpacks strategy.
<4> The base image on which your application runs.
<5> The builder image used by Cloud Native Buildpacks (CNB) to detect and build your application.
<6> The subdirectory within your Git repository where the application source code is located.
<7> The location where the built image is pushed.
<1> Defines the Git repository containing your application source code.
<2> Defines the build strategy to build the container.
<3> Defines the parameters set for the buildpacks strategy.
<4> Specifies the base image on which your application runs.
<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 @@ -141,21 +140,25 @@ $ shp build create buildpack-nodejs-build \
--param-value="cnb-builder-image=paketobuildpacks/builder-jammy-tiny:0.0.344" \
--param-value="run-image=paketobuildpacks/run-ubi8-base:latest"
----
. Check if the `Build` resource was created:
.. Using `oc` CLI:

. Check if the `Build` resource was created by using one of the following CLIs:
* 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:
.. .. Using `oc` CLI:

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

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

* Using `shp` CLI:
+
...
[source,terminal]
----
$ shp build run buildpack-nodejs-buildrun --follow
Expand All @@ -199,14 +202,16 @@ $ shp buildrun create buildpack-nodejs-<buildrun_resource_name> --buildref-name
$ shp buildrun logs buildpack-nodej-<buildrun_resource_name> --follow
----
====
. Check if the `BuildRun` resource was created:
.. Using `oc` CLI:

. Check if the `BuildRun` resource was created by using one of the following CLIs:
* 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.
Loading