Skip to content
Crow CI

Volumes

Volume mounts can be defined in the YAML config file. This can be used to mount files or directories on the host machine (or Persistent Volumes in Kubernetes) into pipeline containers.

steps:
  - name: build
    [...]
    volumes:
      - /etc/ssl/certs:/etc/ssl/certs

For the docker backend, volumes are mounted to the host machine. This requires the use of absolute paths when configuring volumes. Attempting to use relative paths will result in an error.

Use temp_volumes when a workflow needs disk-backed shared storage that should not persist after the run. The source is a logical workflow-local name, not a host path. Crow creates the real backend volume when the workflow starts and removes it when the workflow finishes, fails, or is canceled.

services:
  - name: dind
    image: docker:dind
    privileged: true
    temp_volumes:
      - dind:/var/run

steps:
  - name: build
    image: docker
    temp_volumes:
      - dind:/var/run
    commands:
      - docker version

To mount volumes in Kubernetes, PersistentVolumeClaim (PVC) is which can be referenced in steps via the volumes option.

There is no support for dynamic provisioning of PersistentVolumes in Kubernetes. Persistent volumes, which are referenced from the PVCs, must be created manually/statically.

Assuming a PVC named “cache” exists, it can be referenced as follows:

In a plugin,

steps:
  - name: "step name"
    image: <image>
    volumes:
      - cache:/mnt/cache
    [...]