diff --git a/src/tech/avroid/kube/PodTemplates.groovy b/src/tech/avroid/kube/PodTemplates.groovy index e1765a5..acf6eef 100644 --- a/src/tech/avroid/kube/PodTemplates.groovy +++ b/src/tech/avroid/kube/PodTemplates.groovy @@ -463,4 +463,33 @@ class PodTemplates implements Serializable { body.call() } } + + public void sonarQube(imageVersion='11.2', body) { + this.script.podTemplate( + cloud: this.cloud, + imagePullSecrets: this.dockerCreds, + containers: [ + this.script.containerTemplate( + alwaysPullImage: true, + name: 'sonar-scanner-cli', + image: "${this.registry}/docker-hub-proxy/sonar-scanner-cli:${imageVersion}", + ttyEnabled: true, + command: "cat", + resourceRequestCpu: '5', + resourceRequestMemory: '10Gi', + resourceLimitCpu: '7', + resourceLimitMemory: '16Gi', + ), + ], + showRawYaml: false, + volumes: [ + this.script.emptyDirVolume(memory: false, mountPath: '/tmp'), + ], + workspaceVolume: this.script.emptyDirWorkspaceVolume(false), + ) + + { + body.call() + } +} }