Temporary Volumes

Temporary mounts are docker volumes that are created before the pipeline start and destroyed when the pipeline completes. They can be used to share files or folders among pipeline steps.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
kind: pipeline
type: kubernetes
name: default

steps:
- name: test
  image: golang
  volumes:
  - name: cache
    path: /go
  commands:
  - go get
  - go test

- name: build
  image: golang
  volumes:
  - name: cache
    path: /go
  commands:
  - go build

volumes:
- name: cache
  temp: {}

tmpfs can be used to speed up pipelines by storing files frequently wrote and read in memory instead of hard drive.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
kind: pipeline
type: kubernetes
name: default

steps:
- name: test
  image: golang
  volumes:
  - name: cache
    path: /cache
  commands:
  - go get
  - go test

volumes:
- name: cache
  temp:
    medium: memory