Skip to main content

Build

API Group: environments.blanketops.dev

Version: v1alpha1

Scope: Namespaced


Description​

Build represents the deterministic transformation of governed source into a container image artifact.

It defines artifact destination, execution strategy, source configuration, identity binding, and execution policy.

Build objects are responsible for producing a verifiable image artifact


Spec​

FieldTypeRequiredDescription
contractobjectYesBuild execution contract

spec.contract​

FieldTypeRequiredDescription
imagestringYesTarget container image reference
strategyobjectYesExecution strategy definition
sourceobjectYesSource repository configuration
serviceAccountobjectYesExecution identity binding
policyobjectNoTrigger and retry policy configuration
timeoutdurationNoMaximum duration for a single build run
timeToLivedurationNoHow long to retain the BuildRun after completion
githubEventstringNoName of the triggering GitHubEvent CR, if build-triggered

spec.contract.strategy​

FieldTypeRequiredDescription
kindstringYesStrategy type (e.g. ClusterBuildStrategy)
namestringYesName of strategy resource

spec.contract.source​

FieldTypeRequiredDescription
urlstringYesGit repository URL
revisionstringYesBranch, tag, or commit reference
contextDirstringYesBuild context directory
depthintegerNoGit clone depth (shallow clone); 0 means full history
sslVerifybooleanNoWhether to verify SSL certs when cloning over HTTPS
cloneSecretstringNoSecret for repository authentication

spec.contract.serviceAccount​

FieldTypeRequiredDescription
namestringYesKubernetes ServiceAccount name
secretstringNoSecret containing registry credentials

spec.contract.policy​

FieldTypeRequiredDescription
allowedTriggers[]objectNoAllowed trigger types
retryobjectNoRetry configuration

spec.contract.policy.allowedTriggers[]​

FieldTypeRequiredDescription
typestringYesAllowed event type (e.g. push, pull_request)

spec.contract.policy.retry​

FieldTypeRequiredDescription
onFailurebooleanNoRetry on failure
maxAttemptsintegerNoMaximum retry attempts

Status​

FieldTypeDescription
phasestringCurrent lifecycle phase
imagestringProduced image reference, once known
executionRefstringName of the underlying Shipwright BuildRun
messagestringHuman-readable status detail
startTimestringExecution start timestamp
completionTimestringExecution completion timestamp

status.phase Values​

ValueMeaning
PendingBuild registered but not yet started
RunningBuild execution in progress
SucceededArtifact successfully produced
FailedBuild execution failed

Example​

apiVersion: environments.blanketops.dev/v1alpha1
kind: Build
metadata:
name: for-kaniko-app
namespace: dev
spec:
contract:
image: docker.io/example/for-kaniko-app:master
strategy:
kind: ClusterBuildStrategy
name: kaniko
source:
url: git@github.com:example-org/for-kaniko-app.git
revision: master
contextDir: .
cloneSecret: git-ssh-credentials
serviceAccount:
name: build-bot
secret: registry-credentials
policy:
allowedTriggers:
- type: push
- type: pull_request

Invariants​

  • image must be a valid container image reference.
  • strategy.kind must correspond to a registered build strategy.
  • source.revision must be resolvable.
  • serviceAccount.name must exist in the namespace.
  • status.image is set once the build completes and does not change afterward.
  • Build does not modify Deployment or Route resources.