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