liveBook · Manning

BuildConfig

As explained in Quarkus in Action

A BuildConfig is an OpenShift resource that defines how a build is triggered and how its output is produced.

A BuildConfig defines how OpenShift builds an application image and where the resulting image is published. With a source-to-image build, a locally built JAR is pushed to OpenShift, which builds and runs the application image. section 11.3.4

A BuildConfig connects the build pipeline to OpenShift deployment resources:

  • Uses a sourceStrategy based on the openjdk-21:1.20 ImageStreamTag. section 11.3.4
  • Publishes output to the inventory-service:1.0.0-SNAPSHOT ImageStreamTag. section 11.3.4
  • Triggers automatic redeployment when the output ImageStreamTag changes. section 11.3.4

Inventory service build

The generated OpenShift configuration defines a binary BuildConfig named inventory-service. Its source is binary, its source strategy uses the openjdk-21:1.20 ImageStreamTag, and its output is inventory-service:1.0.0-SNAPSHOT. section 11.3.4

Listing 11.15 Continuation of the simplified generated openshift.yml
---
apiVersion: build.openshift.io/v1
kind: BuildConfig
  ...
  name: inventory-service
  namespace: default
spec:
  output:
    to:
      kind: ImageStreamTag
      name: inventory-service:1.0.0-SNAPSHOT
  source:
    binary: {}
  strategy:
    sourceStrategy:
      from:
        kind: ImageStreamTag
        name: openjdk-21:1.20
---
apiVersion: apps/v1
kind: Deployment
  ...
  name: inventory-service
  namespace: default
spec:
  ...
    spec:
      containers:
        ...
            - name: JAVA_APP_JAR
              value: /deployments/quarkus-run.jar
          image: quay.io/quarkus-in-action/inventory-service:1.0.0
          imagePullPolicy: Always

Inspect the BuildConfig and Deployment definitions together to see how build output feeds application rollout. section 11.3.4

How Quarkus in Action covers it

How deep it goes
Defines binary input, source strategy, JDK ImageStreamTag, and output ImageStreamTag, but not detailed build internals.
Examples
Uses an inventory-service binary build with the openjdk-21:1.20 input and inventory-service:1.0.0-SNAPSHOT output.
What it assumes
Requires a locally built JAR, OpenShift ImageStreams, and an OpenShift deployment manifest.
What you can do after
Operate/configure an OpenShift build that produces an application image and updates its Deployment.
How it connects
Connects source-to-image, ImageStream, ImageStreamTag, Deployment, and automatic redeployment.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.