Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI/CD pipeline extended with custom docker image #5216

Draft
wants to merge 15 commits into
base: 2.x
Choose a base branch
from
149 changes: 139 additions & 10 deletions etc/jenkins/Jenkinsfile_ci_build
Original file line number Diff line number Diff line change
@@ -1,5 +1,137 @@
pipeline {
agent none
agent {
kubernetes {
label 'ci-agent-pod'
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
spec:
volumes:
- name: tools
persistentVolumeClaim:
claimName: tools-claim-jiro-jersey
- name: volume-known-hosts
configMap:
name: known-hosts
- name: settings-xml
secret:
secretName: m2-secret-dir
items:
- key: settings.xml
path: settings.xml
- name: toolchains-xml
configMap:
name: m2-dir
items:
- key: toolchains.xml
path: toolchains.xml
- name: settings-security-xml
secret:
secretName: m2-secret-dir
items:
- key: settings-security.xml
path: settings-security.xml
- name: m2-repo
emptyDir: {}

containers:
- name: jdk8
resources:
limits:
memory: "1024Mi"
cpu: "2000m"
requests:
memory: "512Mi"
cpu: "1000m"
image: tkraus/el-build:2.0.2
volumeMounts:
- name: volume-known-hosts
mountPath: /home/jenkins/.ssh
- name: tools
mountPath: /opt/tools
- name: settings-xml
mountPath: /home/jenkins/.m2/settings.xml
subPath: settings.xml
readOnly: true
- name: toolchains-xml
mountPath: /home/jenkins/.m2/toolchains.xml
subPath: toolchains.xml
readOnly: true
- name: settings-security-xml
mountPath: /home/jenkins/.m2/settings-security.xml
subPath: settings-security.xml
readOnly: true
- name: m2-repo
mountPath: /home/jenkins/.m2/repository
tty: true
command:
- cat
- name: jdk11
resources:
limits:
memory: "1024Mi"
cpu: "2000m"
requests:
memory: "512Mi"
cpu: "1000m"
image: tkraus/el-build:2.0.2
volumeMounts:
- name: volume-known-hosts
mountPath: /home/jenkins/.ssh
- name: tools
mountPath: /opt/tools
- name: settings-xml
mountPath: /home/jenkins/.m2/settings.xml
subPath: settings.xml
readOnly: true
- name: toolchains-xml
mountPath: /home/jenkins/.m2/toolchains.xml
subPath: toolchains.xml
readOnly: true
- name: settings-security-xml
mountPath: /home/jenkins/.m2/settings-security.xml
subPath: settings-security.xml
readOnly: true
- name: m2-repo
mountPath: /home/jenkins/.m2/repository
tty: true
command:
- cat
- name: jdk19
resources:
limits:
memory: "1024Mi"
cpu: "2000m"
requests:
memory: "512Mi"
cpu: "1000m"
image: tkraus/el-build:2.0.2
volumeMounts:
- name: volume-known-hosts
mountPath: /home/jenkins/.ssh
- name: tools
mountPath: /opt/tools
- name: settings-xml
mountPath: /home/jenkins/.m2/settings.xml
subPath: settings.xml
readOnly: true
- name: toolchains-xml
mountPath: /home/jenkins/.m2/toolchains.xml
subPath: toolchains.xml
readOnly: true
- name: settings-security-xml
mountPath: /home/jenkins/.m2/settings-security.xml
subPath: settings-security.xml
readOnly: true
- name: m2-repo
mountPath: /home/jenkins/.m2/repository
tty: true
command:
- cat
"""
}
}

options {
timeout(time: 30, activity: true, unit: 'HOURS')
Expand All @@ -9,46 +141,43 @@ pipeline {
stage('Jersey build') {
parallel {
stage('JDK 8 ') {
agent {
label 'centos-7'
}
tools {
jdk 'oracle-jdk8-latest'
maven 'apache-maven-latest'
}
steps {
container("jdk8") {
sh '''
bash ${WORKSPACE}/etc/jenkins/jenkins_build.sh
'''
}
}
}
stage('JDK 11 ') {
agent {
label 'centos-7'
}
tools {
jdk 'openjdk-jdk11-latest'
maven 'apache-maven-latest'
}
steps {
container("jdk11") {
sh '''
bash ${WORKSPACE}/etc/jenkins/jenkins_build.sh
'''
}
}
}
stage('JDK 19 ') {
agent {
label 'centos-7'
}
tools {
jdk 'openjdk-jdk19-latest'
maven 'apache-maven-latest'
}
steps {
container("jdk19") {
sh '''
bash ${WORKSPACE}/etc/jenkins/jenkins_build.sh
'''
}
}
}
}
}
Expand Down