ci: move build scratch off node runtime storage
This commit is contained in:
parent
f68c848f4d
commit
8520f340d6
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
@ -1,11 +1,16 @@
|
|||||||
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 'tester'
|
defaultContainer 'tester'
|
||||||
yaml """
|
yaml """
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
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"
|
||||||
@ -49,8 +54,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: workspace-volume
|
- name: workspace-volume
|
||||||
mountPath: /home/jenkins/agent
|
mountPath: /home/jenkins/agent
|
||||||
- name: builder
|
- name: builder
|
||||||
@ -89,20 +95,20 @@ spec:
|
|||||||
volumes:
|
volumes:
|
||||||
- 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
|
||||||
items:
|
items:
|
||||||
- key: .dockerconfigjson
|
- key: .dockerconfigjson
|
||||||
path: config.json
|
path: config.json
|
||||||
- name: workspace-volume
|
|
||||||
emptyDir: {}
|
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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'
|
||||||
PIP_DISABLE_PIP_VERSION_CHECK = '1'
|
PIP_DISABLE_PIP_VERSION_CHECK = '1'
|
||||||
PYTHONUNBUFFERED = '1'
|
PYTHONUNBUFFERED = '1'
|
||||||
SUITE_NAME = 'atlasbot'
|
SUITE_NAME = 'atlasbot'
|
||||||
@ -118,6 +124,11 @@ spec:
|
|||||||
buildDiscarder(logRotator(daysToKeepStr: '30', numToKeepStr: '200', artifactDaysToKeepStr: '30', artifactNumToKeepStr: '120'))
|
buildDiscarder(logRotator(daysToKeepStr: '30', numToKeepStr: '200', artifactDaysToKeepStr: '30', artifactNumToKeepStr: '120'))
|
||||||
}
|
}
|
||||||
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