[DO-1395] add_podtemplate (#50)
Co-authored-by: Rustam Tagaev <rustam.tagaev@avroid.tech> Reviewed-on: https://git.avroid.tech/DevOps/jenkins-shared-lib/pulls/50 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
79a8b725ce
commit
426b6beb9f
@@ -226,4 +226,38 @@ class PodTemplates implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public void nodejs(imageVersion='18.16-alpine3.18', body) {
|
||||
this.script.podTemplate(
|
||||
runAsUser: "0",
|
||||
imagePullSecrets: this.dockerCreds,
|
||||
containers: [
|
||||
this.script.containerTemplate(
|
||||
alwaysPullImage: true,
|
||||
name: 'nodejs',
|
||||
image: "${this.registry}/devops/node:${imageVersion}",
|
||||
envVars: [
|
||||
this.script.containerEnvVar(key: 'HOME', value: '/home/jenkins'),
|
||||
],
|
||||
ttyEnabled: true,
|
||||
command: "cat",
|
||||
resourceRequestCpu: '100m',
|
||||
resourceLimitCpu: '100m',
|
||||
resourceRequestMemory: '1024Mi',
|
||||
resourceLimitMemory: '1024Mi',
|
||||
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