Work with Builds builds for Red Hat OpenShift 1.1 Using Builds Red Hat OpenShift Documentation Team

Commands:
oc apply -f - <<EOF apiVersion: shipwright.io/v1beta1 kind: Build metadata: name: buildah-golang-build spec: source: 1 type: Git git: url: https://github.com/shipwright-io/sample-go contextDir: docker-build strategy: 2 name: buildah kind: ClusterBuildStrategy paramValues: 3 - name: dockerfile value: Dockerfile output: 4 image: image-registry.openshift-image-registry.svc:5000/buildah-example/sample-go-app EOF
shp build create buildah-golang-build --source-url="https://github.com/redhat-openshift-builds/samples" --source-context-dir="buildah-build" \ 1 --strategy-name="buildah" \ 2 --dockerfile="Dockerfile" \ 3 --output-image="image-registry.openshift-image-registry.svc:5000/buildah-example/go-app" 4
oc get builds.shipwright.io buildah-golang-build
shp build list
oc apply -f - <<EOF apiVersion: shipwright.io/v1beta1 kind: BuildRun metadata: name: buildah-golang-buildrun spec: build: name: buildah-golang-build 1 EOF
shp build run buildah-golang-build --follow 1
oc get buildrun buildah-golang-buildrun
shp buildrun list
oc get pods -w
NAME READY STATUS RESTARTS AGE buildah-golang-buildrun-dtrg2-pod 2/2 Running 0 4s buildah-golang-buildrun-dtrg2-pod 1/2 NotReady 0 7s buildah-golang-buildrun-dtrg2-pod 0/2 Completed 0 55s
oc get tr
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME buildah-golang-buildrun-dtrg2 True Succeeded 11m 8m51s
oc get br
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME buildah-golang-buildrun True Succeeded 13m 11m
podman pull image-registry.openshift-image-registry.svc:5000/<project>/<image> 1
oc apply -f - <<EOF apiVersion: shipwright.io/v1beta1 kind: Build metadata: name: s2i-nodejs-build spec: source: 1 type: Git type: Git git: url: https://github.com/redhat-openshift-builds/samples contextDir: s2i-build/nodejs strategy: 2 name: source-to-image kind: ClusterBuildStrategy paramValues: 3 - name: builder-image value: quay.io/centos7/nodejs-12-centos7:master output: image: quay.io/<repo>/s2i-nodejs-example 4 pushSecret: registry-credential 5 EOF
shp build create s2i-nodejs-build --source-url="https://github.com/redhat-openshift-builds/samples" --source-context-dir="s2i-build/nodejs" \ 1 --strategy-name="source-to-image" \ 2 --builder-image="quay.io/centos7/nodejs-12-centos7" \ 3 --output-image="quay.io/<repo>/s2i-nodejs-example" \ 4 --output-credentials-secret="registry-credential" 5
oc get builds.shipwright.io s2i-nodejs-build
shp build list
oc apply -f - <<EOF apiVersion: shipwright.io/v1beta1 kind: BuildRun metadata: name: s2i-nodejs-buildrun spec: build: name: s2i-nodejs-build 1 EOF
shp build run s2i-nodejs-build --follow 1
oc get buildrun s2i-nodejs-buildrun
shp buildrun list
oc get pods -w
NAME READY STATUS RESTARTS AGE s2i-nodejs-buildrun-phxxm-pod 2/2 Running 0 10s s2i-nodejs-buildrun-phxxm-pod 1/2 NotReady 0 14s s2i-nodejs-buildrun-phxxm-pod 0/2 Completed 0 2m
oc get tr
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME s2i-nodejs-buildrun-phxxm True Succeeded 2m39s 13s
oc get br
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME s2i-nodejs-buildrun True Succeeded 2m41s 15s
podman pull quay.io/<repo>/<image> 1
oc logs <buildrun_resource_name>
shp buildrun logs <buildrun_resource_name>
oc delete builds.shipwright.io <build_resource_name>
shp build delete <build_resource_name>
oc delete buildrun <buildrun_resource_name>
shp buildrun delete <buildrun_resource_name>
oc delete buildstrategies <buildstartegy_resource_name>