ci: move build scratch off node runtime storage
This commit is contained in:
parent
831d6f817c
commit
8b6195c2e6
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@ -2,10 +2,15 @@ pipeline {
|
|||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
defaultContainer 'tester'
|
defaultContainer 'tester'
|
||||||
|
// Build scratch belongs on storage volumes, not the node runtime USB drive.
|
||||||
|
workspaceVolume dynamicPVC(accessModes: 'ReadWriteOnce', requestsSize: '20Gi', storageClassName: 'ci-scratch')
|
||||||
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"
|
||||||
@ -72,12 +77,17 @@ spec:
|
|||||||
volumes:
|
volumes:
|
||||||
- name: docker-config-writable
|
- name: docker-config-writable
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
- 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'
|
||||||
|
GOCACHE = '/home/jenkins/agent/.cache/go-build'
|
||||||
|
GOMODCACHE = '/home/jenkins/agent/.cache/go-mod'
|
||||||
|
GOTMPDIR = '/home/jenkins/agent/.cache/go-tmp'
|
||||||
SUITE_NAME = 'soteria'
|
SUITE_NAME = 'soteria'
|
||||||
PUSHGATEWAY_URL = 'http://platform-quality-gateway.monitoring.svc.cluster.local:9091'
|
PUSHGATEWAY_URL = 'http://platform-quality-gateway.monitoring.svc.cluster.local:9091'
|
||||||
SONARQUBE_HOST_URL = 'http://sonarqube.quality.svc.cluster.local:9000'
|
SONARQUBE_HOST_URL = 'http://sonarqube.quality.svc.cluster.local:9000'
|
||||||
@ -104,6 +114,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
|
||||||
@ -114,6 +129,7 @@ spec:
|
|||||||
container('tester') {
|
container('tester') {
|
||||||
sh '''
|
sh '''
|
||||||
set -eu
|
set -eu
|
||||||
|
mkdir -p "$GOCACHE" "$GOMODCACHE" "$GOTMPDIR"
|
||||||
apt-get update >/dev/null
|
apt-get update >/dev/null
|
||||||
apt-get install -y --no-install-recommends bash git jq curl python3 ripgrep >/dev/null
|
apt-get install -y --no-install-recommends bash git jq curl python3 ripgrep >/dev/null
|
||||||
'''
|
'''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user