fixed jenkinsfile

This commit is contained in:
2025-06-21 19:36:05 +04:00
parent c7f7aa9dc1
commit 33152be84f

18
Jenkinsfile vendored
View File

@ -4,26 +4,32 @@ pipeline {
environment { environment {
FASTDL_CONTAINER = "fastdl" FASTDL_CONTAINER = "fastdl"
FASTDL_PATH = "/usr/share/nginx/html" FASTDL_PATH = "/usr/share/nginx/html"
TARGET_DIR = "/opt/game-servers/csdm"
REPO_URL = "https://gitea.go-yasozdal.ru/yvnger/csdm"
BRANCH = "main"
} }
stages { stages {
stage("Checkout") { stage("Prepare Deploy Directory") {
steps { 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 { steps {
script { dir("$TARGET_DIR") {
sh 'docker build -t csserver:csdm .' sh 'docker build -t csserver:csdm .'
} }
} }
} }
stage('Deploy with Compose') { stage("Deploy with Compose") {
steps { steps {
script { dir("$TARGET_DIR") {
sh 'docker-compose down || true' sh 'docker-compose down || true'
sh 'docker-compose up -d' sh 'docker-compose up -d'
} }