For the complete documentation index, see llms.txt. This page is also available as Markdown.

Variables

Variables can be set at pipeline, stage and step levels.

The order of precedence for environment variables with the same name is step > stage > pipeline.

Pipeline

Pipeline environment variables are available to all run steps in your pipeline.

kind: pipeline
spec:
  options:
    envs:
      GOOS: linux
      GOARCH: amd64
  stages:
  - type: ci
    spec:
      steps:
      - name: test 1.20
        type: run
        spec:
          container: golang:1.20
          script: |
            go build
            go test

      - name: test 1.21
        type: run
        spec:
          container: golang:1.21
          script: |
            go build
            go test

Stage

Stage environment variables are available to all run steps in the stage.

Step

Run step environment variables are only available to the step.

Background steps also support environment variables.

Last updated

Was this helpful?