From 33152be84f9f6aed04a033eef8bf9a81616d3f09 Mon Sep 17 00:00:00 2001 From: Yaroslav Pleshakov Date: Sat, 21 Jun 2025 19:36:05 +0400 Subject: [PATCH] fixed jenkinsfile --- Jenkinsfile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4e0837e..e2bc17a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,26 +4,32 @@ pipeline { environment { FASTDL_CONTAINER = "fastdl" FASTDL_PATH = "/usr/share/nginx/html" + TARGET_DIR = "/opt/game-servers/csdm" + REPO_URL = "https://gitea.go-yasozdal.ru/yvnger/csdm" + BRANCH = "main" } stages { - stage("Checkout") { + stage("Prepare Deploy Directory") { steps { - checkout scm + sh ''' + rm -rf $TARGET_DIR + git clone --branch $BRANCH $REPO_URL $TARGET_DIR + ''' } } - stage('Build Docker Image') { + stage("Build Docker Image") { steps { - script { + dir("$TARGET_DIR") { sh 'docker build -t csserver:csdm .' } } } - stage('Deploy with Compose') { + stage("Deploy with Compose") { steps { - script { + dir("$TARGET_DIR") { sh 'docker-compose down || true' sh 'docker-compose up -d' }