[DO-1361] add some new methods to Git and Nexus (#47)
Co-authored-by: Rustam Tagaev <rustam.tagaev@avroid.tech> Reviewed-on: https://git.avroid.tech/DevOps/jenkins-shared-lib/pulls/47 Reviewed-by: Denis Patrakeev <denis.patrakeev@avroid.team> Co-authored-by: Rustam Tagaev <rustam.tagaev@avroid.team> Co-committed-by: Rustam Tagaev <rustam.tagaev@avroid.team>
This commit is contained in:
committed by
Denis Patrakeev
parent
e7158b0c4f
commit
4b96e40909
@@ -19,6 +19,7 @@ class PodTemplates implements Serializable {
|
||||
effect: NoSchedule
|
||||
"""
|
||||
}
|
||||
|
||||
public void jnlp(body) {
|
||||
this.script.podTemplate(
|
||||
containers: [
|
||||
@@ -92,7 +93,6 @@ class PodTemplates implements Serializable {
|
||||
|
||||
public void docker(body) {
|
||||
this.script.podTemplate(
|
||||
// serviceAccount: 'jenkins-privileged',
|
||||
imagePullSecrets: this.dockerCreds,
|
||||
containers: [
|
||||
this.script.containerTemplate(
|
||||
@@ -104,9 +104,6 @@ class PodTemplates implements Serializable {
|
||||
],
|
||||
ttyEnabled: true,
|
||||
command: '/usr/local/bin/dockerd-entrypoint.sh',
|
||||
// args: """--insecure-registry=${registry} \
|
||||
// --bip=192.168.222.1/24 \
|
||||
// --storage-driver=overlay""",
|
||||
privileged: true,
|
||||
resourceRequestCpu: '500m',
|
||||
resourceLimitCpu: '4',
|
||||
@@ -118,7 +115,6 @@ class PodTemplates implements Serializable {
|
||||
instanceCap: 1,
|
||||
showRawYaml: false,
|
||||
volumes: [
|
||||
// this.script.secretVolume(secretName: 'docker-config', mountPath: '/home/jenkins/.docker'),
|
||||
this.script.emptyDirVolume(memory: false, mountPath: '/var/lib/docker'),
|
||||
this.script.emptyDirVolume(memory: false, mountPath: '/home/jenkins/.local'),
|
||||
this.script.emptyDirVolume(memory: false, mountPath: '/home/jenkins/.cache'),
|
||||
@@ -131,4 +127,36 @@ class PodTemplates implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public void git(imageVersion='v2.45.2', body) {
|
||||
this.script.podTemplate(
|
||||
containers: [
|
||||
this.script.containerTemplate(
|
||||
alwaysPullImage: true,
|
||||
name: 'git',
|
||||
image: "${registry}/docker-hub-proxy/alpine/git:${imageVersion}",
|
||||
envVars: [
|
||||
this.script.containerEnvVar(key: 'HOME', value: '/home/jenkins'),
|
||||
],
|
||||
ttyEnabled: true,
|
||||
command: "cat",
|
||||
resourceRequestCpu: '100m',
|
||||
resourceLimitCpu: '100m',
|
||||
resourceRequestMemory: '32Mi',
|
||||
resourceLimitMemory: '32Mi',
|
||||
workingDir: '/jenkins',
|
||||
),
|
||||
],
|
||||
instanceCap: 1,
|
||||
showRawYaml: false,
|
||||
volumes: [
|
||||
this.script.emptyDirVolume(memory: false, mountPath: '/tmp'),
|
||||
],
|
||||
workspaceVolume: this.script.emptyDirWorkspaceVolume(false),
|
||||
)
|
||||
|
||||
{
|
||||
body.call()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user