Workspaces

A workspace is a volume used as the working directory for all the steps of a pipeline execution. This is achieved via a Persistent Volume mounted to the Pods that represent build steps. A default workspace will match the pattern below, based on your repository url.

/cicd/src/github.com/octocat/hello-world

The workspace can be customized via the workspace block in the YAML file:

+workspace:
+  base: /go
+  path: src/github.com/octocat/hello-world

pipeline:
  build:
    image: golang:latest
    commands:
      - go get
      - go test

The base attribute defines a shared base volume available to all pipeline steps that ensures your source code, dependencies and compiled binaries are persisted and shared between steps.

workspace:
+ base: /go
  path: src/github.com/octocat/hello-world

pipeline:
  deps:
    image: golang:latest
    commands:
      - go get
      - go test
  build:
    image: node:latest
    commands:
      - go build

The path attribute defines the working directory of your build, which is where your code is cloned. It functions as the default working directory of every step in your build process. The path is relative, and combined with your base path.

workspace:
  base: /go
+ path: src/github.com/octocat/hello-world
git clone https://github.com/octocat/hello-world \
  /go/src/github.com/octocat/hello-world