From 863cf1b3e4b0dea53788dc405d48fb11181f0639 Mon Sep 17 00:00:00 2001 From: The_Spider Date: Wed, 6 Jul 2022 21:37:21 -0500 Subject: [PATCH] adds blocks --- build-projectzomboid.jenkins | 49 ++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/build-projectzomboid.jenkins b/build-projectzomboid.jenkins index 306a5d3..668ea3d 100644 --- a/build-projectzomboid.jenkins +++ b/build-projectzomboid.jenkins @@ -17,7 +17,8 @@ pipeline { yaml functions.podYaml( repo: repository, templateName: templateName, - kaniko: true + kaniko: true, + alpine: true ) } } @@ -56,21 +57,37 @@ ENTRYPOINT ["/bin/bash", "-c", "/home/steam/ProjectZomboid/start-server.sh"] } } - declarativeFunctions.buildContainer( - repository: repository, - imageDest: "${repository}/library/project-zomboid:latest", - dockerFile: dockerFile, - repoCreds: repositoryCreds, - [ - "STEAM_TOKEN=${steamToken}", - ], - ) + stage ('Build & Push') { + steps { + container ('kaniko') { + script { + declarativeFunctions.buildContainer( + repository: repository, + imageDest: "${repository}/library/project-zomboid:latest", + dockerFile: dockerFile, + repoCreds: repositoryCreds, + [ + "STEAM_TOKEN=${steamToken}", + ], + ) + } + } + } + } - declarativeFunctions.functions.deletePod( - kubeAuth: "k8s-game-servers-access", - kubeURL: "https://k8s.test-chamber-13.lan:8043", - namespace: "game-servers", - selector: "app=project-zomboid" - ) + stage ('Delete Running Container') { + steps { + container ('alpine') { + script { + declarativeFunctions.functions.deletePod( + kubeAuth: "k8s-game-servers-access", + kubeURL: "https://k8s.test-chamber-13.lan:8043", + namespace: "game-servers", + selector: "app=project-zomboid" + ) + } + } + } + } } } \ No newline at end of file