Skip to content

Commit

Permalink
feat(apps/prod/tekton/configs): add cache for crypress installtion
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhuizuo committed Sep 9, 2024
1 parent 3be1409 commit ade37be
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
description: the base OCI registry server for store artifacts, it can be set with prefix repo path.
default: "hub.pingcap.net"
- name: force-builder-image
description: >
description: >
The builder image to use for building binaries by force, if empty.
Default the task will complete one from config in artifacts.git repo.
type: string
Expand All @@ -63,6 +63,9 @@ spec:
- name: cargo-home
description: cache for cargo pacakges when build binaries
optional: true
- name: cypress-cache
description: cache for cypress installation files when building frontend projects.
optional: true
tasks:
- name: checkout
retries: 2
Expand Down Expand Up @@ -161,6 +164,8 @@ spec:
workspace: dockerconfig
- name: cargo-home
workspace: cargo-home
- name: crypress-cache
workspace: crypress-cache
- name: build-images
when:
- input: "$(params.push)"
Expand Down
11 changes: 11 additions & 0 deletions apps/prod/tekton/configs/pvcs/crypress-cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cypress-cache
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 20Gi
storageClassName: ceph-block
1 change: 1 addition & 0 deletions apps/prod/tekton/configs/pvcs/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cargo-home.yaml
- crypress-cache.yaml
- tiup-locks.yaml
6 changes: 6 additions & 0 deletions apps/prod/tekton/configs/tasks/pingcap-build-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ spec:
description: Cache for cargo packages.
mountPath: /workspace/.cargo
optional: true
- name: cypress-cache
description: Cache for cypress installation files.
mountPath: /workspace/.cache/Cypress
optional: true
- name: dockerconfig
description: Includes a docker `config.json`
mountPath: /root/.docker
Expand Down Expand Up @@ -97,6 +101,8 @@ spec:
value: /workspace/.cargo
- name: NPM_CONFIG_REGISTRY
value: https://registry.npmmirror.com
- name: CYPRESS_CACHE_FOLDER
value: /workspace/.cache/Cypress
script: |
script="/workspace/build-package-artifacts.sh"
if [ ! -f "$script" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ spec:
- name: cargo-home
persistentVolumeClaim:
claimName: cargo-home
- name: cypress-cache
persistentVolumeClaim:
claimName: cypress-cache
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
Expand Down Expand Up @@ -173,6 +176,9 @@ spec:
- name: cargo-home
persistentVolumeClaim:
claimName: cargo-home
- name: cypress-cache
persistentVolumeClaim:
claimName: cypress-cache
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ spec:
- name: cargo-home
persistentVolumeClaim:
claimName: cargo-home
- name: cypress-cache
persistentVolumeClaim:
claimName: cypress-cache
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ spec:
secretName: git-credentials-basic
- name: cargo-home
persistentVolumeClaim:
claimName: cargo-home
claimName: cargo-home
- name: cypress-cache
persistentVolumeClaim:
claimName: cypress-cache
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
Expand Down Expand Up @@ -175,3 +178,6 @@ spec:
- name: cargo-home
persistentVolumeClaim:
claimName: cargo-home
- name: cypress-cache
persistentVolumeClaim:
claimName: cypress-cache

0 comments on commit ade37be

Please sign in to comment.