circleci

package
v8.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAppCatalog     = "giantswarm-catalog"
	DefaultAppCatalogTest = "giantswarm-test-catalog"
)

DefaultAppCatalog and DefaultAppCatalogTest are the catalogs the chart pipeline publishes to when a repo does not override them. They match the long-standing template hardcodes, so repos that do not set a catalog get the identical config they had before the override existed.

View Source
const (
	PackageManagerNPM         = "npm"
	PackageManagerYarn        = "yarn"
	PackageManagerYarnClassic = "yarn-classic"
	PackageManagerPNPM        = "pnpm"
)

Package-manager values detected from the lockfile. Yarn Berry and Yarn Classic are distinguished because their install commands and cache directories differ (Berry: `--immutable` + .yarn/cache; Classic: `--frozen-lockfile` + ~/.cache/yarn), and the two cannot be told apart from the lockfile name alone.

View Source
const (
	DefaultBuildConcurrency = "auto"
	DefaultResourceClass    = "large"
)

DefaultBuildConcurrency and DefaultResourceClass are the go-build knobs the cli flavour applies when a repo does not override them. They match the long-standing template hardcodes, so cli repos that set neither render the identical config they had before the overrides existed. Only the cli flavour (ReleaseBinaries) emits these; a non-cli go-build job stays on the orb/CircleCI defaults.

View Source
const ContinuationOrbVersion = "2.0.1"

ContinuationOrbVersion pins the circleci/continuation orb used by the generated setup config (.circleci/config.yml) to merge the optional repo-owned .circleci/custom.yml into .circleci/workflows.yml at pipeline runtime. Baked in for the same reason as OrbVersion: a bump ships with a devctl release and reaches repos via align-files.

renovate: datasource=orb depName=circleci/continuation

View Source
const DefaultNodeTestTarget = "test"

DefaultNodeTestTarget is the package.json script the Node job runs for the verify phase when a repo does not override it. The repo composes typecheck/lint/format/test into its own `test` script -- the make-target interface (the Node analogue of `make test`), so CI and local runs share one command.

View Source
const NodeImageVersion = "24.18.0"

NodeImageVersion is the cimg/node Docker tag the generated Node job runs on. Baked in (not a flag) and Renovate-managed, for the same reason as the orb pins: a toolchain bump ships with a devctl release and reaches repos via align-files rather than drifting per repo.

renovate: datasource=docker depName=cimg/node

View Source
const OrbVersion = "9.5.5"

OrbVersion is the aligned giantswarm/architect orb version every generated CircleCI config pins. It is baked in next to the template -- not a flag and not passed in by callers -- so that an orb bump (which can change the template's required job/param shape, i.e. a cross-major compatibility contract) forces a new devctl release rather than silently combining a stale template with a newer orb at generation time.

Renovate keeps this current; a major bump lands as a devctl PR, gets released, and only then reaches repos via the align-files devctl pin.

Tracked via github-tags on the architect-orb source repo rather than the `orb` datasource: the generated renovate.json5 disables `orb` updates for giantswarm/architect (so they stop fighting align-files in .circleci/config.yml), and that root packageRule would otherwise also block this constant. The custom manager that reads this annotation lives in renovate-custom.json5.

renovate: datasource=github-tags depName=giantswarm/architect-orb

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type CircleCI

type CircleCI struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*CircleCI, error)

func (*CircleCI) ATSInputs added in v8.27.0

func (c *CircleCI) ATSInputs() []input.Input

ATSInputs returns the canonical app-test-suite (ATS) Pipfile input for chart/app (.HasApp) repos, and nil otherwise. ATS chart tests run only for .HasApp -- the same signal that gates the run-tests-with-ats jobs -- so the Pipfile is emitted under exactly that condition and from the same generator call site (devctl gen circleci, the only generator invoked inside align's `if (ci && ci.generate)` guard). That makes "ATS Pipfile only when CI is generated, and only for chart/app repos" structurally guaranteed rather than dependent on a separate, differently-scoped invocation.

func (*CircleCI) SetupConfig added in v8.11.0

func (c *CircleCI) SetupConfig() input.Input

SetupConfig is the static dynamic-config setup workflow written to .circleci/config.yml. It merges the optional repo-owned custom.yml into workflows.yml at pipeline runtime.

func (*CircleCI) Workflows added in v8.11.0

func (c *CircleCI) Workflows() input.Input

Workflows is the derived golden pipeline content written to .circleci/workflows.yml.

type Config

type Config struct {
	// RepoName is the repository name, used for the binary, chart, and job
	// names.
	RepoName string
	// Language is the repo language. "go" selects the go-build job.
	Language gen.Language
	// Flavours are the devctl gen flavours. The "app" flavour selects the
	// chart pipeline.
	Flavours gen.FlavourSlice
	// HasDockerfile selects the image pipeline. The runner derives this from
	// the presence of a Dockerfile in the repo.
	HasDockerfile bool
	// AppCatalog overrides the catalog the chart pipeline publishes to. Empty
	// defaults to "giantswarm-catalog". Set it for repos that ship to a
	// different catalog (e.g. the internal "giantswarm-operations-platform")
	// so generation does not migrate their chart to the public catalog.
	AppCatalog string
	// AppCatalogTest overrides the test catalog. Empty defaults to
	// "giantswarm-test-catalog". Kept paired with AppCatalog.
	AppCatalogTest string
	// ChartName overrides the chart name (the push-to-app-catalog `chart`
	// param and the helm/<chart> directory). Empty defaults to RepoName. Set it
	// for repos whose chart directory does not match the repo name (e.g.
	// docs-proxy ships helm/docs-proxy-app).
	ChartName string
	// ForcePublic pushes the image and chart as public artifacts even though
	// the repo is private (architect force-public: true). Set it for private
	// repos that publish public artifacts (e.g. web-assets). Mutually exclusive
	// with ImagePrivateOnly.
	ForcePublic bool
	// BranchPublish opts the repo into publishing a dev image and chart on
	// branch builds. By default branches build + test only (no push). When
	// set, the branch path additionally pushes an amd64 dev image and the
	// dev chart, coupled (both or neither).
	BranchPublish bool
	// ImagePreBuildJob names a repo-owned custom.yml job the image build must
	// wait on (adds a `requires` entry to push-to-registries-release and the
	// branch build-image / push-to-registries job). Used for workspace-handoff
	// pre-steps the append-only custom.yml merge cannot inject into a generated
	// job. Empty for the common case.
	ImagePreBuildJob string
	// ImageDockerfile overrides the Dockerfile path on the image jobs (the
	// architect push-to-registries `dockerfile` param). A non-empty value also
	// forces the image pipeline on, so a repo whose Dockerfile is not at the
	// repo root (e.g. backstage -> packages/backend/Dockerfile) still generates
	// image jobs. Empty keeps the orb default ("Dockerfile") and leaves the
	// root-Dockerfile derivation untouched.
	ImageDockerfile string
	// ImagePrivateOnly ships the image to the private registry only
	// (gsociprivate), replacing split-china-push and omitting sync-china-registry.
	// Set it for private repos whose image must not land in the public catalog.
	ImagePrivateOnly bool
	// ImageName overrides the `giantswarm/<repo>` default image name on the
	// image jobs. Set it for repos whose published image differs from the repo
	// name (e.g. kserve -> giantswarm/kserve-controller). Empty keeps the orb
	// default.
	ImageName string
	// ImagePlatforms overrides the buildx platform list on the image jobs.
	// Empty lets the orb default apply. Set it for single-architecture images
	// (e.g. vllm -> linux/arm64).
	ImagePlatforms string
	// BuildConcurrency overrides how many architectures the cli-flavour
	// go-build job compiles concurrently (the architect go-build
	// `build_concurrency` param). Empty defaults to "auto" (nproc). Lower it
	// (e.g. "2") for repos whose binary is large enough that a cold full-matrix
	// cross-compile OOMs the runner at `auto` -- memory, not CPU, is the binding
	// constraint, and a killed build never stores the build cache, so the repo
	// stays permanently cold. Only applies to the cli flavour (ReleaseBinaries).
	BuildConcurrency string
	// ResourceClass overrides the CircleCI resource_class on the cli-flavour
	// go-build job. Empty defaults to "large". Raise it (e.g. "xlarge") for
	// repos that need more RAM/CPU headroom for the cold cross-compile. Only
	// applies to the cli flavour (ReleaseBinaries).
	ResourceClass string
	// PackageManager selects the Node package manager the build/test job uses
	// (one of "npm", "yarn", "yarn-classic", "pnpm"). The runner detects it
	// from the lockfile; empty defaults to Yarn Berry. Only applies to a Node
	// repo (Language == "node").
	PackageManager string
	// NodeTestTarget overrides the package.json script the Node job runs for
	// the verify phase. Empty defaults to "test". The repo composes
	// typecheck/lint/format/test into this one script (make-target interface).
	// Only applies to a Node repo.
	NodeTestTarget string
	// NodeBuildTarget is the package.json script the Node job runs to build.
	// Empty omits the build step (a library that only verifies). Only applies
	// to a Node repo.
	NodeBuildTarget string
	// NodeBuildOutput is the workspace path the Node job persists for an image
	// handoff (e.g. backstage's "packages/*/dist/*"). Non-empty names the job
	// "node-build" and emits persist_to_workspace; empty names it "node-test".
	// Only applies to a Node repo.
	NodeBuildOutput string
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL