[📝] Jenkinsfile 수정
Some checks failed
Front/pipeline/head There was a failure building this commit

This commit is contained in:
김선규 2024-11-05 14:10:17 +09:00
parent 9ee719503c
commit 9f5a2a0d31

19
Jenkinsfile vendored
View File

@ -18,24 +18,15 @@ pipeline {
stage('Deploy') {
steps {
script {
sh "docker create --name temp-container -v /volume1/AcaMate/PROJECT/Application/Front:/src mcr.microsoft.com/dotnet/sdk:8.0"
sh "docker cp ${WORKSPACE}/. temp-container:/src"
sh "docker rm temp-container"
if (env.GIT_BRANCH == 'main') {
// main 브랜치용 작업
def containerId = sh(script: "docker ps -qf 'name=${DOCKER_RELEASE_RUN_CONTAINER}'", returnStdout: true).trim()
if (containerId) {
sh "docker cp ${WORKSPACE}/. ${containerId}:${APP_VOLUME}"
sh "docker start ${DOCKER_RELEASE_RUN_CONTAINER}"
} else {
error "Docker container ${DOCKER_RELEASE_RUN_CONTAINER} not found"
}
sh "docker start ${DOCKER_RELEASE_RUN_CONTAINER}"
} else if (env.GIT_BRANCH == 'debug') {
// debug 브랜치용 작업
def containerId = sh(script: "docker ps -qf 'name=${DOCKER_DEBUG_RUN_CONTAINER}'", returnStdout: true).trim()
if (containerId) {
sh "docker cp ${WORKSPACE}/. ${containerId}:${APP_VOLUME}"
sh "docker start ${DOCKER_DEBUG_RUN_CONTAINER}"
} else {
error "Docker container ${DOCKER_DEBUG_RUN_CONTAINER} not found"
}
sh "docker start ${DOCKER_DEBUG_RUN_CONTAINER}"
}
}
}