Skip to main content
KodeShift pipelines are defined as YAML files in a .kodeshift/ directory at the root of your Git repository. This guide covers every configuration option available.

Directory Structure

When you initialize a pipeline through the UI, this entire structure is generated automatically on a dedicated kodeshift branch in your repository.

Main Configuration (.kodeshift.yaml)

The entry point defines which stages exist and which files to include.

Fields

Use the list format for stages. The dict format (stages: {dev: [...], qa: [...]}) is legacy and limits dynamic environment selection.

Job Definitions (.kodeshift-pipeline.yaml)

Each top-level key is a job name. The key must match one of the stages declared in .kodeshift.yaml.

Field Reference

Both snake_case and camelCase field names are accepted (e.g. stage_group or stageGroup).

Image Configuration

For standard jobs, only name is needed. The command, args, and env fields are used for specialized containers like Kaniko that require a custom entrypoint.

Script References

Scripts in init and script fields support several formats.

Reference syntax (@)

Reference a reusable block defined in .kodeshift-common.yaml:
The legacy use_ prefix also works (use_clone_scripts) but @ is preferred.

Inline commands

Advanced formats

Scripts can also be objects:

Common Scripts (.kodeshift-common.yaml)

Define reusable script blocks that jobs reference with @:
Each key becomes a referenceable script name. Values are command lists following the same formats described above.

Environment Pattern Matching

The environments field on each job uses pattern matching to determine which environments a job runs in.

Conditional allow_fail

allow_fail can be a list of environment names instead of a boolean:

Trigger Configuration (.kodeshift-trigger.yaml)

Defines which Git events trigger the pipeline and how branches/tags map to environments.

Trigger Types

Branch Patterns

  • feature/* — matches one path segment (e.g. feature/login)
  • feature/** — matches nested segments (e.g. feature/user/auth)
  • v* — matches tags like v1.0.0, v2.1.3-beta

Environment Mapping

Maps the branch or tag pattern to an environment name. When a webhook fires, the pipeline runner looks up the matching pattern to determine which environment to deploy to.

Workflow Models

Development happens on short-lived branches merged to main. Production deploys are triggered by tagging.

Parallel Execution (Stage Groups)

Jobs that share the same stage_group and stage_group_order run in parallel:
Both jobs execute simultaneously within the analysis stage.

Helm Chart Integration

The .kodeshift/chart/ directory holds a standard Helm chart used by ArgoCD for deployment.
During deployment, ArgoCD applies values-${ENV}.yaml on top of the base values.yaml, so you only need to specify overrides per environment.

Pipeline Lifecycle

Built-in Variables

These variables are available in all scripts via ${VARIABLE} syntax.
Sensitive variables like GIT_TOKEN, ARGOCD_PASSWORD, and SONAR_TOKEN are injected from Vault at runtime and are never stored in your YAML files.

Validation Rules

When a pipeline is saved or triggered, the system validates:
  1. Main YAML schemastages and includes must conform to the expected structure
  2. Included files exist — every path in includes must resolve to a valid file
  3. Stage references — each job’s stage field must match a declared stage name
  4. Environment consistency (legacy dict format only) — environments declared in job files must match those in the stages dict
  5. Common scripts — YAML syntax is validated but references are resolved at runtime
Validation errors include the file path, stage name, and specific mismatch details to help you fix issues quickly.

Complete Example

A minimal but complete pipeline with four stages: