updates variables
This commit is contained in:
		@@ -1,12 +1,14 @@
 | 
			
		||||
#!groovy
 | 
			
		||||
 | 
			
		||||
def label = podTemplates.podLabel()
 | 
			
		||||
def repository = "registry.c.test-chamber-13.lan"
 | 
			
		||||
def repositoryCreds = "harbor-repository-creds"
 | 
			
		||||
 | 
			
		||||
podTemplate(
 | 
			
		||||
    label: label,
 | 
			
		||||
    name: "pipeline-worker",
 | 
			
		||||
    yaml: podTemplates.podYaml(
 | 
			
		||||
        repo: repository,
 | 
			
		||||
        kaniko: true,
 | 
			
		||||
        alpine: true,
 | 
			
		||||
    ),
 | 
			
		||||
 
 | 
			
		||||
@@ -6,8 +6,7 @@ def podLabel() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// return kubernetes pod defination
 | 
			
		||||
def podYaml(Map requiredContainers){
 | 
			
		||||
    def dockerRepo = "registry.c.test-chamber-13.lan"
 | 
			
		||||
def podYaml(Map config){
 | 
			
		||||
    def output = """
 | 
			
		||||
---
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
@@ -17,21 +16,21 @@ metadata:
 | 
			
		||||
spec:
 | 
			
		||||
  containers:
 | 
			
		||||
"""
 | 
			
		||||
    if (requiredContainers.kaniko == true) {
 | 
			
		||||
    if (config.kaniko == true) {
 | 
			
		||||
        output += """
 | 
			
		||||
  - name: kaniko
 | 
			
		||||
    imagePullPolicy: Always
 | 
			
		||||
    image: ${dockerRepo}/library/kaniko:latest
 | 
			
		||||
    image: ${config.repo}/library/kaniko:latest
 | 
			
		||||
    tty: true
 | 
			
		||||
    command:
 | 
			
		||||
    - /busybox/sh
 | 
			
		||||
"""
 | 
			
		||||
    }
 | 
			
		||||
    if (requiredContainers.alpine == true) {
 | 
			
		||||
    if (config.alpine == true) {
 | 
			
		||||
        output += """
 | 
			
		||||
  - name: alpine
 | 
			
		||||
    imagePullPolicy: Always
 | 
			
		||||
    image: ${dockerRepo}/library/alpine:latest
 | 
			
		||||
    image: ${config.repo}/library/alpine:latest
 | 
			
		||||
    tty: true
 | 
			
		||||
"""
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user