Cum să folosești cache pentru task-uri în Concourse CI
DodaTech
Updated 2025-01-15
1 min read
In this tutorial, you'll learn about Cum să folosești cache pentru task. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
Cache-ul în Concourse CI accelerează execuția task-urilor prin reutilizarea dependențelor și artefactelor între execuții.
Cache pentru Go modules
jobs:
- name: build
plan:
- task: build
config:
platform: linux
image_resource:
type: registry-image
source:
repository: golang
caches:
- path: gopath/pkg/mod
name: gomod
params:
GOPATH: /tmp/gopath
run:
path: sh
args:
- -c
- |
export GOPATH=/tmp/gopath
go mod download
go build
Cache pentru npm
jobs:
- name: frontend
plan:
- task: build
config:
platform: linux
image_resource:
type: registry-image
source:
repository: node
caches:
- path: node_modules
name: npm-cache
run:
path: sh
args:
- -c
- npm ci && npm run build
Cache pentru pip
jobs:
- name: python-build
plan:
- task: test
config:
platform: linux
image_resource:
type: registry-image
source:
repository: python
caches:
- path: .cache/pip
name: pip-cache
run:
path: sh
args:
- -c
- pip install -r requirements.txt && pytest
Configurare cache per worker
# Configurare fly
fly -t ci set-team \
--team-name myteam \
--worker-cache-path /tmp/concourse-cache
Prevenire
- Numește cache-urile descriptiv
- Verifică periodice integritatea cache-ului
- Dimensionează spațiul de cache adecvat
- Curăță cache-ul la actualizări majore
DodaTech Tools
Doda Browser monitorizează dimensiunea cache-ului. DodaZIP arhivează statistici de cache.
Întrebări frecvente
Construit de echipa Doda Browser, DodaZIP și Durga Antivirus Pro.
← Previous
Cum să folosești webhook-uri ca resursă în Concourse CI
Next →
Cum să selectezi imaginea container pentru un task Concourse CI
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro