From 8e395094054cfc7b454c6326b48d1a5bd820bf1d Mon Sep 17 00:00:00 2001 From: The_Spider Date: Sat, 15 Jan 2022 09:30:43 -0600 Subject: [PATCH] adds pod restart --- build-projectzomboid.jenkins | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/build-projectzomboid.jenkins b/build-projectzomboid.jenkins index 93454cf..d498015 100644 --- a/build-projectzomboid.jenkins +++ b/build-projectzomboid.jenkins @@ -1,4 +1,5 @@ def label = "jenkins-${UUID.randomUUID().toString()}" +def templateName = "pipeline-worker" def repository = "registry.c.test-chamber-13.lan" def kanikoImage = "${repository}/library/kaniko:latest" @@ -10,18 +11,13 @@ def steamTokenName = "ssfn7445013141740368289" podTemplate( label: label, - name: "pipeline-worker", - yaml: """--- -apiVersion: v1 -kind: Pod -spec: - containers: - - name: kaniko - image: ${kanikoImage} - tty: true - command: - - /busybox/cat -""", + name: templateName, + yaml: functions.podYaml( + repo: repository, + templateName: templateName, + kaniko: true, + alpine: true + ) ) { node (label) { def workspace = pwd() @@ -95,5 +91,12 @@ ENTRYPOINT ["/bin/bash", "-c", "/home/steam/ProjectZomboid/start-server.sh"] } } } + + functions.deletePod( + kubeAuth: "rancher-admin-token", + kubeURL: "https://rancher.test-chamber-13.lan/k8s/clusters/c-mc9cq", + namespace: "game-servers", + selector: "workload.user.cattle.io/workloadselector=apps.deployment-game-servers-project-zomboid" + ) } } \ No newline at end of file