Skip to main content

Build Definition

BuildDefinition

BuildDefinition defines the declarative configuration for a software build and containerization process. It supports multiple languages and toolchains (e.g., Go, Java, Python, Flutter, Protobuf) and manages the lifecycle of a build from source code to published artifact.

From a technical perspective, this manifest acts as a structured schema to template CI/CD pipelines (such as GitHub Actions workflows) or internal executors. The engine parses the Spec to generate execution plans consisting of test, security scan, compilation, and container publishing steps.

PropertyTypeDescription
apiVersionstringThe API version of the manifest, enforcing backward compatibility contracts.
kindstringThe resource type discriminator, explicitly defining this block as a BuildDefinition object.
metadatamapCustom metadata for labeling and classifying the resource within the control plane.
specSpecThe concrete configuration driving the build logic.

Spec

Spec contains the user-defined configuration for the build process. It provides variables such as target languages, build flags, platform matrix, and publishing registries which are used by the engine to hydrate the CI/CD pipeline templates.

PropertyTypeDescription
descriptionstringA string providing descriptive context about this build process. This description is optional but will drastically improve the understanding of the AI assistant about the structural elements of the organization.
typestringSpecifies the primary language or toolchain for the build process. Evaluates the discriminator branch for pipeline stages and executor images in workflows.
workDirstringRoot directory where the build will take place. Applies the base execution directory path context for all pipeline stages.
privateboolIf true, indicates that the source code for this build is in a private repository that requires authentication. Configures pipeline authentication mechanisms required to checkout external module references.
pathstringThe relative path within the source repository to the code that should be built. If not specified, the root of the repository is used. Overrides targeted execution directories for discrete compilation phases.
stageslist of stringA list of prioritized build stages to execute. Defines chronological step blocks mapping directly onto generated workflow definitions.
golangGolangSettings specific to building Go applications. Required if 'type' is 'GOLANG'.
flutterFlutterSettings specific to building Flutter applications. Required if 'type' is 'FLUTTER'.
protobufProtobufSettings for compiling Protobuf definitions. Required if 'type' is 'PROTOBUF'.
pythonPythonSettings specific to building Python applications. Required if 'type' is 'PYTHON'.
javaJavaSettings specific to building Java applications. Required if 'type' is 'JAVA'.
mojoMojoSettings specific to building Mojo applications. Required if 'type' is 'MOJO'.
helmHelmSettings for packaging Helm charts. Required if 'type' is 'HELM'.
publishPublishDefines where to natively publish the final artifact of a build, typically used for language-specific packages like Go modules or Python packages.
containerizelist of ContainerizeDefines one or more container images to be built and uploaded. Requires the 'containerize' phase to be declared in stages.
validatorValidatorDefines a custom, ad-hoc execution validation stage for the build. Required if 'type' is 'VALIDATOR'.
terraformTerraformSettings for packaging and publishing Terraform modules. Required if 'type' is 'TERRAFORM'.

Containerize

Containerize dictates the translation of code or binaries into an OCI-compliant image. Generates steps interacting with Docker Buildx to leverage layer caching, structural metadata stamping, and registry uploads.

PropertyTypeDescription
namestringA unique name for the container image to be built. This name is used for tagging the final image.
dockerfilestringThe path to the Dockerfile within the source repository. If not specified, it defaults to 'Dockerfile' in the build 'path'.
platformslist of stringA list of platforms to build the container image for (e.g., 'linux/amd64', 'linux/arm64'). Controls the cross-compilation matrix variables for the container build phases.
registrieslist of stringA list of 'ArtifactRegistry' manifest names where the built container image will be pushed.

Flutter

Flutter configures builds for Flutter/Dart applications. It captures Flutter SDK channels, target platforms, and publish registries to translate into the relevant flutter build commands per target interface.

PropertyTypeDescription
optionslist of stringCommand-line options to pass to the flutter build.
versionslist of stringFlutter SDK versions to use for the build matrix.
channelstringThe SDK release channel (stable, beta, standard).
platformslist of stringTarget compilation platforms (web, android, ios, windows, macos, linux).
registrystringTarget registry to publish the compiled outputs or packages.

Golang

Golang configures builds for Go applications. It captures standard Go toolchain parameters like CGO settings, target platforms, and build flags to dynamically generate the required go build matrix in the CI/CD pipeline.

PropertyTypeDescription
buildTypestringSpecifies whether to build a binary ('bin') or a library ('lib'). Dictates the final build command and output artifacts. 'bin' produces an executable, while 'lib' produces a package for use in other Go projects.
obfuscatedboolExplicit toggle to obfuscate Go builds using Garble. Drives the compiler to use an obfuscated build toolchain instead of standard execution.
targetstringThe path to the main package to be built (e.g., './cmd/server'). Instructs the build pipeline on the specific target location.
buildFlagslist of stringA list of additional flags to pass to the 'go build' command (e.g., '-ldflags "-X main.version=1.2.3"').
versionslist of stringA list of Go versions to build against. Orchestrates dynamic build matrices across multiple version targets to ensure compatibility.
platformsTargetPlatformsDefines the operating systems (goos) and architectures (goarch) to build for. Populates platform constraints into the build matrix dynamic generation.
cgoCgoConfiguration for builds that require CGO. Injects environment flags and required external compilation libraries.

Cgo

Cgo manages C-language interop dependencies during the Go build. Technically, it toggles CGO_ENABLED and injects -ldflags or C-compiler library dependencies.

PropertyTypeDescription
enabledboolSet to true to enable CGO for the build.
librarieslist of stringA list of system libraries to link against (e.g., '-lm').
gccFlagslist of stringA list of additional flags to pass to the C compiler.

Platform

Platform represents a single target OS and architecture combination. Used to explicitly ignore or specify exact cross-compilation binaries.

PropertyTypeDescription
goarchstring
goosstring

TargetPlatforms

TargetPlatforms defines the cross-compilation matrix. This is translated into a build matrix array in GitHub Actions, dynamically spawning parallel jobs for each valid GOOS/GOARCH combination minus exclusions.

PropertyTypeDescription
gooslist of stringA list of target operating systems (e.g., 'linux', 'windows', 'darwin').
goarchlist of stringA list of target CPU architectures (e.g., 'amd64', 'arm64').
ignorelist of PlatformA list of OS/architecture combinations to exclude from the build matrix.

Helm

Helm configures packaging steps for Kubernetes Helm Charts. Automates helm lint, helm package, and helm push within the pipeline process.

PropertyTypeDescription
chartLocationstringThe path to the Helm chart within the source repository. Configures the working directory bound to packaging commands.

Java

Java configures Maven or Gradle JVM-based builds. Generates CI steps that rely on standard JVM docker images passing along JDK targets and registry URIs for JAR/WAR deployments.

PropertyTypeDescription
buildTypestringSpecifies whether to output a standalone binary ('bin') or a dependency library ('lib').
buildToolstringThe specific JVM build toolchain to utilize.
versionslist of stringJDK versions forming the build execution matrix.
registrieslist of stringList of Maven/Gradle registries to push the produced JAR instances.
mavenMavenNative settings applied purely to Maven-oriented toolchains.

Maven

Maven encapsulates settings specific to the Maven build toolchain. Defines plugin caching properties to speed up iterative pipeline runs.

PropertyTypeDescription
cacheCache

Cache

Cache instructs the CI pipeline to perform directory caching of /root/.m2/repository. Determines cache step generation for the workflow pipeline.

PropertyTypeDescription
enabledbool

Mojo

Mojo configures native compile flows utilizing the modular Mojo compiler structure. Passes LLVM/MLIR compilation properties to translate .mojo files down to binaries/libraries.

PropertyTypeDescription
buildTypestringSpecifies whether to output a standalone binary ('bin') or a dependency library ('lib').
buildFlagslist of stringCompilation flags passed to mojo build.
srcFilestringTarget source file defining the entrypoint.
platformslist of stringTarget operational systems to natively cross-compile outputs to.
registrystringRegistry to push the compiled outputs.

Protobuf

Protobuf configures source code generation from Protocol Buffer definitions. It triggers protoc or buf pipelines to fetch dependencies and compile generated clients.

PropertyTypeDescription
generatorslist of stringA list of languages for which to generate Protobuf client/server code. Specifies target language plugins to run during schema generation.
dependencieslist of DependencyA list of external Protobuf repositories that this build depends on.
registrystringThe name of the 'ArtifactRegistry' manifest where the generated Protobuf artifacts will be published.

Dependency

Dependency points to a remote module or repository containing required .proto files. Triggers dependency updates to resolve correct external schema revisions.

PropertyTypeDescription
organizationstring
repositorystring
revisionstring

Publish

Publish instructs the generic pipeline phase to upload generic outputs to a registry. Driven inherently by language choices (e.g. Go modules).

PropertyTypeDescription
registrystringThe name of the 'ArtifactRegistry' manifest where the final build artifact will be published.

Python

Python configures builds and isolated environments for Python utilities. Maps standard commands like pip, pytest, or PyPI registry publishes using tox/poetry logic under the hood.

PropertyTypeDescription
targetstringMain module to trace or compile for packaging.
buildFlagslist of stringBuild flags to append when executing the Python environment bootstrap or build package.
versionslist of stringArray of Python interpreter versions to run tests/builds against in the matrix.
registrystringTarget pip-compliant registry name in Artifact Registry to push the wheel/egg.
runCmdstringCommand string used to natively run the application during non-containerized scopes.
testCmdstringCommand string used to invoke tests (e.g. pytest ./tests).

Terraform

Terraform automates linting and module packaging for Hashicorp standard configurations. Enforces terraform validate and publishing zipped module versions.

PropertyTypeDescription
moduleslist of stringA list of relative paths corresponding to Terraform modules to be packaged or published.
registrieslist of stringA list of ArtifactRegistry manifests configured for Terraform modules where the modules will be published.

Validator

Validator allows custom bash/shell evaluation injection. Spawns standalone shell steps to parse proprietary code semantics before passing the build chain.

PropertyTypeDescription
scriptstringA script string or file path to be executed to validate the build artifacts or source code.