ci(soteria): remove dind from quality runs and harden post
This commit is contained in:
parent
ed91af0ce5
commit
7859457c8b
45
Jenkinsfile
vendored
45
Jenkinsfile
vendored
@ -1,7 +1,7 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
defaultContainer 'builder'
|
defaultContainer 'tester'
|
||||||
yaml """
|
yaml """
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
@ -10,22 +10,6 @@ spec:
|
|||||||
kubernetes.io/arch: arm64
|
kubernetes.io/arch: arm64
|
||||||
node-role.kubernetes.io/worker: "true"
|
node-role.kubernetes.io/worker: "true"
|
||||||
containers:
|
containers:
|
||||||
- name: dind
|
|
||||||
image: docker:27-dind
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
env:
|
|
||||||
- name: DOCKER_TLS_CERTDIR
|
|
||||||
value: ""
|
|
||||||
args:
|
|
||||||
- "--mtu=1400"
|
|
||||||
- "--host=unix:///var/run/docker.sock"
|
|
||||||
- "--host=tcp://0.0.0.0:2375"
|
|
||||||
volumeMounts:
|
|
||||||
- name: dind-storage
|
|
||||||
mountPath: /var/lib/docker
|
|
||||||
- name: workspace-volume
|
|
||||||
mountPath: /home/jenkins/agent
|
|
||||||
- name: builder
|
- name: builder
|
||||||
image: docker:27
|
image: docker:27
|
||||||
command:
|
command:
|
||||||
@ -54,8 +38,6 @@ 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
|
||||||
@ -99,12 +81,11 @@ spec:
|
|||||||
}
|
}
|
||||||
stage('Prep toolchain') {
|
stage('Prep toolchain') {
|
||||||
steps {
|
steps {
|
||||||
container('builder') {
|
container('tester') {
|
||||||
sh '''
|
sh '''
|
||||||
set -eu
|
set -eu
|
||||||
apk add --no-cache bash git jq curl
|
apt-get update >/dev/null
|
||||||
mkdir -p /root/.docker
|
apt-get install -y --no-install-recommends bash git jq curl python3 ripgrep >/dev/null
|
||||||
cp /docker-config/config.json /root/.docker/config.json
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -462,12 +443,22 @@ PY
|
|||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
script {
|
script {
|
||||||
if (fileExists('build.env')) {
|
try {
|
||||||
def env = readProperties file: 'build.env'
|
if (fileExists('build.env')) {
|
||||||
echo "Build complete for ${env.SEMVER}"
|
def env = readProperties file: 'build.env'
|
||||||
|
echo "Build complete for ${env.SEMVER}"
|
||||||
|
}
|
||||||
|
} catch (Throwable err) {
|
||||||
|
echo "post workspace unavailable for build.env: ${err.class.simpleName}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
script {
|
||||||
|
try {
|
||||||
|
archiveArtifacts artifacts: 'build/*', allowEmptyArchive: true
|
||||||
|
} catch (Throwable err) {
|
||||||
|
echo "archive skipped: ${err.class.simpleName}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
archiveArtifacts artifacts: 'build/*', allowEmptyArchive: true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user