[DO-1373] refactoring_pod_templates (#48)

Co-authored-by: Rustam Tagaev <rustam.tagaev@avroid.tech>
Reviewed-on: https://git.avroid.tech/DevOps/jenkins-shared-lib/pulls/48
This commit is contained in:
Rustam Tagaev
2024-11-26 18:50:20 +03:00
parent 4b96e40909
commit 44c303a190

View File

@@ -20,13 +20,13 @@ class PodTemplates implements Serializable {
""" """
} }
public void jnlp(body) { public void jnlp(imageVersion='jdk17', body) {
this.script.podTemplate( this.script.podTemplate(
containers: [ containers: [
this.script.containerTemplate( this.script.containerTemplate(
alwaysPullImage: true, alwaysPullImage: true,
name: 'jnlp', name: 'jnlp',
image: "${this.registry}/docker-hub-proxy/jenkins/inbound-agent:jdk17", image: "${this.registry}/docker-hub-proxy/jenkins/inbound-agent:${imageVersion}",
envVars: [ envVars: [
this.script.containerEnvVar(key: 'HOME', value: '/home/jenkins'), this.script.containerEnvVar(key: 'HOME', value: '/home/jenkins'),
], ],
@@ -56,14 +56,14 @@ class PodTemplates implements Serializable {
} }
} }
public void poetry(body) { public void poetry(imageVersion='1.8.4', body) {
this.script.podTemplate( this.script.podTemplate(
imagePullSecrets: this.dockerCreds, imagePullSecrets: this.dockerCreds,
containers: [ containers: [
this.script.containerTemplate( this.script.containerTemplate(
alwaysPullImage: true, alwaysPullImage: true,
name: 'poetry', name: 'poetry',
image: "${this.registry}/devops/poetry:1.8.4", image: "${this.registry}/devops/poetry:${imageVersion}",
envVars: [ envVars: [
this.script.containerEnvVar(key: 'HOME', value: '/home/jenkins'), this.script.containerEnvVar(key: 'HOME', value: '/home/jenkins'),
], ],
@@ -91,14 +91,14 @@ class PodTemplates implements Serializable {
} }
} }
public void docker(body) { public void docker(imageVersion='27.3.1-dind',body) {
this.script.podTemplate( this.script.podTemplate(
imagePullSecrets: this.dockerCreds, imagePullSecrets: this.dockerCreds,
containers: [ containers: [
this.script.containerTemplate( this.script.containerTemplate(
alwaysPullImage: true, alwaysPullImage: true,
name: 'docker', name: 'docker',
image: "${registry}/docker-hub-proxy/docker:27.3.1-dind", image: "${registry}/docker-hub-proxy/docker:${imageVersion}",
envVars: [ envVars: [
this.script.containerEnvVar(key: 'HOME', value: '/home/jenkins'), this.script.containerEnvVar(key: 'HOME', value: '/home/jenkins'),
], ],