ci: move build scratch off node runtime storage
All checks were successful
Tests / Declarative: Post Actions passed: 314
All checks were successful
Tests / Declarative: Post Actions passed: 314
This commit is contained in:
parent
2db096650e
commit
3f30c3040e
24
Jenkinsfile
vendored
24
Jenkinsfile
vendored
@ -1,6 +1,8 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
|
// Keep build I/O off the node's runtime USB drive.
|
||||||
|
workspaceVolume dynamicPVC(accessModes: 'ReadWriteOnce', requestsSize: '40Gi', storageClassName: 'ci-scratch')
|
||||||
defaultContainer 'builder'
|
defaultContainer 'builder'
|
||||||
retries 2
|
retries 2
|
||||||
yaml """
|
yaml """
|
||||||
@ -10,6 +12,9 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app: metis
|
app: metis
|
||||||
spec:
|
spec:
|
||||||
|
securityContext:
|
||||||
|
fsGroup: 1000
|
||||||
|
fsGroupChangePolicy: OnRootMismatch
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
kubernetes.io/arch: arm64
|
kubernetes.io/arch: arm64
|
||||||
node-role.kubernetes.io/worker: "true"
|
node-role.kubernetes.io/worker: "true"
|
||||||
@ -56,8 +61,9 @@ spec:
|
|||||||
- --host=tcp://0.0.0.0:2375
|
- --host=tcp://0.0.0.0:2375
|
||||||
- --tls=false
|
- --tls=false
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: dind-storage
|
- name: workspace-volume
|
||||||
mountPath: /var/lib/docker
|
mountPath: /var/lib/docker
|
||||||
|
subPath: .cache/docker
|
||||||
- name: builder
|
- name: builder
|
||||||
image: registry.bstein.dev/bstein/docker:27
|
image: registry.bstein.dev/bstein/docker:27
|
||||||
command: ["cat"]
|
command: ["cat"]
|
||||||
@ -105,12 +111,8 @@ spec:
|
|||||||
- name: workspace-volume
|
- name: workspace-volume
|
||||||
mountPath: /home/jenkins/agent
|
mountPath: /home/jenkins/agent
|
||||||
volumes:
|
volumes:
|
||||||
- name: workspace-volume
|
|
||||||
emptyDir: {}
|
|
||||||
- name: docker-config-writable
|
- name: docker-config-writable
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
- name: dind-storage
|
|
||||||
emptyDir: {}
|
|
||||||
- name: harbor-config
|
- name: harbor-config
|
||||||
secret:
|
secret:
|
||||||
secretName: harbor-robot-pipeline
|
secretName: harbor-robot-pipeline
|
||||||
@ -121,6 +123,13 @@ spec:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
|
PIP_CACHE_DIR = '/home/jenkins/agent/.cache/pip'
|
||||||
|
NPM_CONFIG_CACHE = '/home/jenkins/agent/.cache/npm'
|
||||||
|
SONAR_USER_HOME = '/home/jenkins/agent/.cache/sonar'
|
||||||
|
TMPDIR = '/home/jenkins/agent/.cache/tmp'
|
||||||
|
GOCACHE = '/home/jenkins/agent/.cache/go-build'
|
||||||
|
GOMODCACHE = '/home/jenkins/agent/.cache/go-mod'
|
||||||
|
GOTMPDIR = '/home/jenkins/agent/.cache/go-tmp'
|
||||||
REGISTRY = 'registry.bstein.dev/bstein'
|
REGISTRY = 'registry.bstein.dev/bstein'
|
||||||
IMAGE = "${REGISTRY}/metis"
|
IMAGE = "${REGISTRY}/metis"
|
||||||
SENTINEL_IMAGE = "${REGISTRY}/metis-sentinel"
|
SENTINEL_IMAGE = "${REGISTRY}/metis-sentinel"
|
||||||
@ -153,6 +162,11 @@ spec:
|
|||||||
pollSCM('H/5 * * * *')
|
pollSCM('H/5 * * * *')
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
|
stage('Prepare build scratch') {
|
||||||
|
steps {
|
||||||
|
sh 'mkdir -p /home/jenkins/agent/.cache/tmp /home/jenkins/agent/.cache/go-tmp'
|
||||||
|
}
|
||||||
|
}
|
||||||
stage('Checkout') {
|
stage('Checkout') {
|
||||||
steps {
|
steps {
|
||||||
checkout scm
|
checkout scm
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user