[CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ข Application Server Docker Job (โ‘ก Application Docker Run)

2023. 7. 6. 15:24ใ†System ์ž‘์—…์‹ค/DevOps

728x90
๋ฐ˜์‘ํ˜•

 

 

 

 

 

 






๐Ÿ—‚ ๋ชฉ์ฐจ

โš ๏ธ ์•„๋ž˜ ๋ชฉ์ฐจ ์ค‘ ๋ช‡๋ช‡๊ฐœ์˜ ๋งํฌ๊ฐ€ ๊ฑธ๋ฆฌ์ง€ ์•Š๋Š” ๋ฌธ์ œ๋กœ ๊ธ€ ๋งจ ํ•˜๋‹จ์— ๋‹ค์Œ ๊ธ€๋กœ ์ด๋™ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด ๋‘์—ˆ์Šต๋‹ˆ๋‹ค.

โœ… [CI/CD] Jenkins์™€ Gitea ์—ฐ๋™
โœ… [CI/CD] Jenkins Trigger ์ •๋ณด Discord๋กœ ๋ณด๋‚ด๊ธฐ
โœ… [CI/CD] ์ •์  ์ฝ”๋“œ ๋ถ„์„ ํˆด SonarQube์™€ Jenkins ์—ฐ๋™
โœ… [CI/CD] SonarQube๋ฅผ ํ†ตํ•ด Code Convention ์ ์šฉ
โœ… [DevOps] JAVA Gradle JaCoCo (Code coverage) ์„ค์ •ํ•˜๊ธฐ 
โœ… [DevOps] JAVA Gradle JaCoCo (Code coverage) ์„ค์ •ํ•˜๊ธฐ (์ถ”๊ฐ€)(https://junyharang.tistory.com/392)

โœ… [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘  Application Linuxt(Ubuntu)์— SSH๋ฅผ ์ด์šฉํ•œ ํŒŒ์ผ ์ „์†ก
โœ… [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ก Create Docker Image And BackUp
โœ… [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ข Application Server Docker Job (โ‘  Application ๋„์ปค ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธ)
โœ… [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ข Application Server Docker Job (โ‘ก Application Docker Run)(https://junyharang.tistory.com/406)
โœ… [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ข Application Server Docker Job (โ‘ข Application Docker Health Check)
โœ… [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ฃ NGINX Server Docker Job (โ‘  NGINX ๊ฐ ์ข… ์„ค์ •) 
โœ… [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ฃ NGINX Server Docker Job (โ‘ก NGINX Docker ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธ) 
โœ… [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ฃ NGINX Server Docker Job (โ‘ข NGINX Docker Run & Health Check)
โœ… [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ฃ NGINX Server Docker Job (โ‘ข NGINX ์žฌ ์„ค์ •)



๐Ÿค” ๋‚ด๊ฐ€ ๋งŒ๋‚œ ๋ฌธ์ œ

โ›”๏ธ [Jenkins] java.lang.OutOfMemoryError: Java heap space

 


 

 

 

๋ฐฐํฌ ์ž๋™ํ™”์™€ ์ง€์†์  ์ธ๋„:๋„์ปค์™€ ์  ํ‚จ์Šค ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค๋กœ ๋งŒ๋“œ๋Š”

COUPANG

www.coupang.com

"์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค."

 

 

 

 

 

๐Ÿš€ Application Docker Run

    ๐Ÿ”ฝ ๊ฐœ์š”

        ๐Ÿ“ฆ ๊ตฌ์„ฑ๋„

CI/CD ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ ๊ตฌ์„ฑ๋„



deploy Directory Path





        ๐Ÿ“ฆ ์†Œ๊ฐœ

์ง€๋‚œ ๊ธ€์—์„œ ์ฃผ๋‹ˆ๋Š” Application Docker Container๊ฐ€ ์‹ค์ œ ์„œ๋ฒ„์— ์กด์žฌํ•˜๋Š”์ง€ ํ™•์ธํ•˜๊ณ , ์กด์žฌ ํ•˜์ง€ ์•Š์•˜์„ ๊ฒฝ์šฐ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๋“ฑ์„ ํ•  ์ˆ˜ ์žˆ๋Š” Shell Script๋ฅผ ๋งŒ๋“ค์–ด ๋ณด์•˜์–ด์š”.

์ด๋ฒˆ์—๋Š” ๋„์ปค ์ปจํ…Œ์ด๋„ˆ ๊ธฐ๋™ ์‰˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๋งŒ๋“ค๊ณ  ๋ถ„์„ํ•ด ๋ณผ๊ฒŒ์š”.






 

    ๐Ÿ”ฝ Shell Script - applicationContainerNewRun.sh

#!/bin/bash

set -e

NOW=$(date +"%y-%m-%d_%H:%M:%S")
SAVE_LOG_DATE=$(date +"%y-%m-%d")

echo "====================================================================================================="
echo "[$NOW] [INFO] ๊ธฐ๊น”๋‚˜๋Š” ์‚ฌ๋žŒ๋“ค ํ†ตํ•ฉ ๊ด€๋ฆฌ ์„œ๋ฒ„ API ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ ์„œ๋ฒ„ ์ž‘์—… ์ค‘ ์ƒˆ๋กœ์šด Application Docker Container ๊ธฐ๋™ ์ž‘์—…์ด ์‹œ์ž‘ ๋˜์—ˆ์–ด์š”."
echo "======================================[$NOW] ํ†ตํ•ฉ ๋ฐฑ ์˜คํ”ผ์Šค ์„œ๋ฒ„ ๋ฐฐํฌ======================================"
echo "[$NOW] [INFO] Author(๋งŒ๋“ ์ด): ์ฃผ๋‹ˆ(junyharang8592@gmail.com)"

APPLICATION_DOCKER_IMAGE_NAME="giggal-people/total-back-office-api"

APPLICATION_MAIN_CONTAINER_NAME="giggal-total-back-office-api-main"
APPLICATION_SUB_CONTAINER_NAME="giggal-total-back-office-api-sub"

APPLICATION_MAIN_EXTERNAL_PORT_NUMBER=1001
APPLICATION_SUB_EXTERNAL_PORT_NUMBER=1011

checkLogDirectory() {
  sleep 5

  LOG_DIR="/var/log/deploy/giggal-total-back-office"

  if [ -d "$LOG_DIR" ];
  then
    echo "=====================================================================================================" >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
    echo "[$NOW] [INFO] ๊ธฐ๊น”๋‚˜๋Š” ์‚ฌ๋žŒ๋“ค ํ†ตํ•ฉ ๊ด€๋ฆฌ ์„œ๋ฒ„ API ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ ์„œ๋ฒ„ ์ž‘์—… ์ค‘ ์ƒˆ๋กœ์šด Application Docker Container ๊ธฐ๋™ ์ž‘์—…์ด ์‹œ์ž‘ ๋˜์—ˆ์–ด์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
    echo "======================================[$NOW] ํ†ตํ•ฉ ๋ฐฑ ์˜คํ”ผ์Šค ์„œ๋ฒ„ ๋ฐฐํฌ======================================" >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
    echo "[$NOW] [INFO] @Author(๋งŒ๋“ ์ด): ์ฃผ๋‹ˆ(junyharang8592@gmail.com)" >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
    echo "[$NOW] [INFO] LOG Directory ์กด์žฌ ํ•ฉ๋‹ˆ๋‹ค."
    echo "[$NOW] [INFO] LOG Directory ์กด์žฌ ํ•ฉ๋‹ˆ๋‹ค." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

  else
      echo "[$NOW] [INFO] cicd-admin์€ mkdir ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์–ด์š”. ๊ด€๋ฆฌ์ž ํ˜น์€ DMSO ํฌ๋ฃจ์—๊ฒŒ ${LOG_DIR} ์ƒ์„ฑ์„ ์š”์ฒญํ•ด ์ฃผ์„ธ์š”. ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์ข…๋ฃŒ๋ฉ๋‹ˆ๋‹ค." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
      exit 1
  fi

  applicationOldDockerContainerRemove
}

applicationOldDockerContainerRemove() {
    echo "[$NOW] [INFO] ๊ธฐ์กด Docker Container ์ค‘์ง€ ๋ฐ ์‚ญ์ œ ์ž‘์—…์„ ์‹œ์ž‘ํ• ๊ฒŒ์š”."
    echo "[$NOW] [INFO] ๊ธฐ์กด Docker Container ์ค‘์ง€ ๋ฐ ์‚ญ์ œ ์ž‘์—…์„ ์‹œ์ž‘ํ• ๊ฒŒ์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

    for loopCount in {1..2}
    do
      if [ "$loopCount" == 1 ];
      then
        echo "[$NOW] [INFO] ${loopCount} ๋ฒˆ์งธ ๋ฐ˜๋ณต๋ฌธ์ด ์‹œ์ž‘๋˜์—ˆ์–ด์š”. Sub์˜ ๊ธฐ์กด Docker Container ํฌํ•จํ•œ ์ค‘์ง€ ๋ฐ ์‚ญ์ œ ๋ช…๋ น์–ด์— ํ•„์š”ํ•œ ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ• ๊ฒŒ์š”."
        echo "[$NOW] [INFO] ${loopCount} ๋ฒˆ์งธ ๋ฐ˜๋ณต๋ฌธ์ด ์‹œ์ž‘๋˜์—ˆ์–ด์š”. Sub์˜ ๊ธฐ์กด Docker Container ํฌํ•จํ•œ ์ค‘์ง€ ๋ฐ ์‚ญ์ œ ๋ช…๋ น์–ด์— ํ•„์š”ํ•œ ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ• ๊ฒŒ์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
        stopContainerAndHostName=$APPLICATION_SUB_CONTAINER_NAME
        portNumber=$APPLICATION_SUB_EXTERNAL_PORT_NUMBER
        stopContainerId=$(docker ps --filter "name=$stopContainerAndHostName" --format "{{.ID}}")

      else
        sleep 10
        echo "[$NOW] [INFO] ${loopCount} ๋ฒˆ์งธ ๋ฐ˜๋ณต๋ฌธ์ด ์‹œ์ž‘๋˜์—ˆ์–ด์š”. Main์˜ ๊ธฐ์กด Docker Container ํฌํ•จํ•œ ์ค‘์ง€ ๋ฐ ์‚ญ์ œ ๋ช…๋ น์–ด์— ํ•„์š”ํ•œ ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ• ๊ฒŒ์š”."
        echo "[$NOW] [INFO] ${loopCount} ๋ฒˆ์งธ ๋ฐ˜๋ณต๋ฌธ์ด ์‹œ์ž‘๋˜์—ˆ์–ด์š”. Main์˜ ๊ธฐ์กด Docker Container ํฌํ•จํ•œ ์ค‘์ง€ ๋ฐ ์‚ญ์ œ ๋ช…๋ น์–ด์— ํ•„์š”ํ•œ ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ• ๊ฒŒ์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
        stopContainerAndHostName=$APPLICATION_MAIN_CONTAINER_NAME
        portNumber=$APPLICATION_MAIN_EXTERNAL_PORT_NUMBER
        stopContainerId=$(docker ps --filter "name=$stopContainerAndHostName" --format "{{.ID}}")
      fi

      echo "[$NOW] [INFO] ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„์„ ํ†ตํ•ด docker ๊ธฐ๋™ ๋ช…๋ น์–ด ๋ณ€์ˆ˜ ์ •๋ณด : "
      echo "[$NOW] [INFO] ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„์„ ํ†ตํ•ด docker ๊ธฐ๋™ ๋ช…๋ น์–ด ๋ณ€์ˆ˜ ์ •๋ณด : " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
      echo "[$NOW] [INFO] ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„ ๋ฐ Host Name : ${stopContainerAndHostName} "
      echo "[$NOW] [INFO] ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„ ๋ฐ Host Name : ${stopContainerAndHostName}  : " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
      echo "[$NOW] [INFO] ${stopContainerAndHostName} ์ปจํ…Œ์ด๋„ˆ Port Number : ${portNumber} "
      echo "[$NOW] [INFO] ${stopContainerAndHostName} ์ปจํ…Œ์ด๋„ˆ Port Number : ${portNumber} : " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
      echo "[$NOW] [INFO] ${stopContainerAndHostName} ์ปจํ…Œ์ด๋„ˆ Docker Image Name : ${APPLICATION_DOCKER_IMAGE_NAME} "
      echo "[$NOW] [INFO] ${stopContainerAndHostName} ์ปจํ…Œ์ด๋„ˆ Docker Image Name : ${APPLICATION_DOCKER_IMAGE_NAME} " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
      echo "[$NOW] [INFO] ์ข…๋ฃŒ ๋ฐ ์ œ๊ฑฐํ•  ๊ธฐ์กด ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„ : ${stopContainerAndHostName} "
      echo "[$NOW] [INFO] ์ข…๋ฃŒ ๋ฐ ์ œ๊ฑฐํ•  ๊ธฐ์กด ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„ : ${stopContainerAndHostName} " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
      echo "[$NOW] [INFO] ${stopContainerAndHostName} ์ปจํ…Œ์ด๋„ˆ ID : ${stopContainerId} "
      echo "[$NOW] [INFO] ${stopContainerAndHostName} ์ปจํ…Œ์ด๋„ˆ ID : ${stopContainerId} " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

      if ! docker stop $stopContainerAndHostName;
      then
        echo "[$NOW] [ERROR] ๊ธฐ์กด ๋™์ž‘ ์ค‘์ด๋˜ Container ์ด๋ฆ„: ${stopContainerAndHostName}, Container ID: ${stopContainerId} ์ข…๋ฃŒ ์ž‘์—… ์‹คํŒจ ํ•˜์˜€์–ด์š”. ์Šคํฌ๋ฆฝํŠธ ์ข…๋ฃŒ ํ•ฉ๋‹ˆ๋‹ค."
        echo "[$NOW] [ERROR] ๊ธฐ์กด ๋™์ž‘ ์ค‘์ด๋˜ Container ์ด๋ฆ„: ${stopContainerAndHostName}, Container ID: ${stopContainerId} ์ข…๋ฃŒ ์ž‘์—… ์‹คํŒจ ํ•˜์˜€์–ด์š”. ์Šคํฌ๋ฆฝํŠธ ์ข…๋ฃŒ ํ•ฉ๋‹ˆ๋‹ค." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
        exit 1

      else
        echo "[$NOW] [INFO] ๊ธฐ์กด ๋™์ž‘ ์ค‘์ด๋˜ Container ์ด๋ฆ„: ${stopContainerAndHostName}, Container ID: ${stopContainerId} ์ข…๋ฃŒ ์ž‘์—… ์„ฑ๊ณต ํ•˜์˜€์–ด์š”."
        echo "[$NOW] [INFO] ๊ธฐ์กด ๋™์ž‘ ์ค‘์ด๋˜ Container ์ด๋ฆ„: ${stopContainerAndHostName}, Container ID: ${stopContainerId} ์ข…๋ฃŒ ์ž‘์—… ์„ฑ๊ณต ํ•˜์˜€์–ด์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
        echo "[$NOW] [INFO] ๊ธฐ์กด ๋™์ž‘ ์ค‘์ด๋˜ Container ์ด๋ฆ„: ${stopContainerAndHostName}, Container ID: ${stopContainerId} ์‚ญ์ œ ์ž‘์—… ์ง„ํ–‰ํ• ๊ฒŒ์š”."
        echo "[$NOW] [INFO] ๊ธฐ์กด ๋™์ž‘ ์ค‘์ด๋˜ Container ์ด๋ฆ„: ${stopContainerAndHostName}, Container ID: ${stopContainerId} ์‚ญ์ œ ์ž‘์—… ์ง„ํ–‰ํ• ๊ฒŒ์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

        if ! docker rm $stopContainerAndHostName;
        then
          echo "[$NOW] [ERROR] ๊ธฐ์กด ๋™์ž‘ ์ค‘์ด๋˜ Container ์ด๋ฆ„: ${stopContainerAndHostName}, Container ID: ${stopContainerId} ์‚ญ์ œ ์ž‘์—… ์‹คํŒจ ํ•˜์˜€์–ด์š”. ์Šคํฌ๋ฆฝํŠธ ์ข…๋ฃŒ ํ•ฉ๋‹ˆ๋‹ค."
          echo "[$NOW] [ERROR] ๊ธฐ์กด ๋™์ž‘ ์ค‘์ด๋˜ Container ์ด๋ฆ„: ${stopContainerAndHostName}, Container ID: ${stopContainerId} ์‚ญ์ œ ์ž‘์—… ์‹คํŒจ ํ•˜์˜€์–ด์š”. ์Šคํฌ๋ฆฝํŠธ ์ข…๋ฃŒ ํ•ฉ๋‹ˆ๋‹ค." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
          exit 1

        else
          echo "[$NOW] [INFO] ๊ธฐ์กด ๋™์ž‘ ์ค‘์ด๋˜ Container ์ด๋ฆ„: ${stopContainerAndHostName}, Container ID: ${stopContainerId} ์‚ญ์ œ ์ž‘์—… ์„ฑ๊ณต ํ•˜์˜€์–ด์š”."
          echo "[$NOW] [INFO] ๊ธฐ์กด ๋™์ž‘ ์ค‘์ด๋˜ Container ์ด๋ฆ„: ${stopContainerAndHostName}, Container ID: ${stopContainerId} ์‚ญ์ œ ์ž‘์—… ์„ฑ๊ณต ํ•˜์˜€์–ด์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

          applicationDockerContainerRun "${stopContainerAndHostName}"
        fi
      fi
    done
}

applicationDockerContainerRun() {
  local containerName=$1

  echo "[$NOW] [INFO] ${containerName} ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„์„ ํ†ตํ•ด docker ๊ธฐ๋™ ๋ช…๋ น์–ด ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ• ๊ฒŒ์š”."
  echo "[$NOW] [INFO] ${containerName} ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„์„ ํ†ตํ•ด docker ๊ธฐ๋™ ๋ช…๋ น์–ด ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ• ๊ฒŒ์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
  echo "[$NOW] [INFO] ${containerName} ์ปจํ…Œ์ด๋„ˆ ๊ธฐ๋™ ์ž‘์—…์„ ์‹œ์ž‘ํ• ๊ฒŒ์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

  if [ "$containerName" == "$APPLICATION_MAIN_CONTAINER_NAME" ];
  then
    containerAndHostName=$APPLICATION_MAIN_CONTAINER_NAME
    portNumber=$APPLICATION_MAIN_EXTERNAL_PORT_NUMBER

  else
    containerAndHostName=$APPLICATION_SUB_CONTAINER_NAME
    portNumber=$APPLICATION_SUB_EXTERNAL_PORT_NUMBER
  fi

  echo "[$NOW] [INFO] ์„ค์ •๋œ ๋ณ€์ˆ˜ ์ •๋ณด: "
  echo "[$NOW] [INFO] ์„ค์ •๋œ ๋ณ€์ˆ˜ ์ •๋ณด: " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
  echo "[$NOW] [INFO] Container Name And Container Host Name : ${containerAndHostName} "
  echo "[$NOW] [INFO] Container Name And Container Host Name : ${containerAndHostName} " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
  echo "[$NOW] [INFO] Container Port Number : ${portNumber} "
  echo "[$NOW] [INFO] Container Port Number : ${portNumber} "  >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

  dockerRunCommand="docker run -itd --privileged --name $containerAndHostName --hostname $containerAndHostName -e container=docker -p $portNumber:8080 --restart unless-stopped $APPLICATION_DOCKER_IMAGE_NAME"

  if ! docker run -itd --privileged --name $containerAndHostName --hostname $containerAndHostName -e container=docker -p $portNumber:8080 --restart unless-stopped $APPLICATION_DOCKER_IMAGE_NAME;
  then
    failedCommand "${dockerRunCommand}"
  else
    successCommand "${dockerRunCommand}"

    containerId=$(docker ps --filter "name=$containerAndHostName" --format "{{.ID}}")

    echo "[$NOW] [INFO] Container ID : ${containerId} "
    echo "[$NOW] [INFO] Container ID : ${containerId} " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
  fi

  echo "[$NOW] [INFO] ๊ธฐ๋™ ์‹œํ‚จ Container ${containerAndHostName} (ID: ${containerId}) ๋™์ž‘ ์ƒํƒœ ํ™•์ธํ• ๊ฒŒ์š”."
  echo "[$NOW] [INFO] ๊ธฐ๋™ ์‹œํ‚จ Container ${containerAndHostName} (ID: ${containerId}) ๋™์ž‘ ์ƒํƒœ ํ™•์ธํ• ๊ฒŒ์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

  checkContainerStatus=$(docker ps --filter "id=$containerId" --format "{{.Status}}")

  sleep 5

  containerLogs=$(docker logs "$containerId")

  if [[ $checkContainerStatus == "Up"* ]];
  then
    echo "[$NOW] [INFO] ๊ธฐ๋™ ์‹œํ‚จ Container ๋‚ด๋ถ€ Log ์ •๋ณด : "
    echo "[$NOW] [INFO] ๊ธฐ๋™ ์‹œํ‚จ Container ๋‚ด๋ถ€ Log ์ •๋ณด : " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
    echo "[$NOW] [INFO] $containerLogs"
    echo "[$NOW] [INFO] $containerLogs" >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

  successCommand "docker ps --filter "id=$containerId" --format "{{.Status}}" "

  else
    echo "[$NOW] [ERROR] ๋ฌธ์ œ ๋ฐœ์ƒํ•œ Container ๋‚ด๋ถ€ Log ์ •๋ณด : "
    echo "[$NOW] [ERROR] ๋ฌธ์ œ ๋ฐœ์ƒํ•œ Container ๋‚ด๋ถ€ Log ์ •๋ณด : " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
    echo "[$NOW] [ERROR] $containerLogs"
    echo "[$NOW] [ERROR] $containerLogs" >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
    failedCommand "docker ps --filter "id=$containerId" --format "{{.Status}}" "
  fi
}

failedCommand() {
  local command=$1

  echo "[$NOW] [ERROR] ${command} ๋ช…๋ น์–ด ์ž‘์—… ์‹คํŒจํ•˜์˜€์–ด์š”. ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค."
  echo "[$NOW] [ERROR] ${command} ๋ช…๋ น์–ด ์ž‘์—… ์‹คํŒจํ•˜์˜€์–ด์š”. ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
  exit 1
}

successCommand() {
  local command=$1

  echo "[$NOW] [INFO] ${command} ๋ช…๋ น์–ด ์ž‘์—… ์„ฑ๊ณตํ•˜์˜€์–ด์š”."
  echo "[$NOW] [INFO] ${command} ๋ช…๋ น์–ด ์ž‘์—… ์„ฑ๊ณตํ•˜์˜€์–ด์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
}

checkLogDirectory

operationDockerStatus=$(docker ps -a)

echo "[$NOW] [INFO] ๊ธฐ๊น”๋‚˜๋Š” ์‚ฌ๋žŒ๋“ค ํ†ตํ•ฉ ๊ด€๋ฆฌ ์„œ๋ฒ„ API ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ ์„œ๋ฒ„ ์ž‘์—… ์ค‘ ์ƒˆ๋กœ์šด Application Docker Container ๊ธฐ๋™ ์ž‘์—…์ด ๋๋‚ฌ์–ด์š”."
echo "[$NOW] [INFO] ๊ธฐ๊น”๋‚˜๋Š” ์‚ฌ๋žŒ๋“ค ํ†ตํ•ฉ ๊ด€๋ฆฌ ์„œ๋ฒ„ API ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ LOG ์œ„์น˜ : ${LOG_DIR}"
echo "[$NOW] [INFO]๊ธฐ๊น”๋‚˜๋Š” ์‚ฌ๋žŒ๋“ค ํ†ตํ•ฉ ๊ด€๋ฆฌ ์„œ๋ฒ„ API ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ ์„œ๋ฒ„ ์ž‘์—… ์ค‘ ์ƒˆ๋กœ์šด Application Docker Container ๊ธฐ๋™ ์ž‘์—…์ด ๋๋‚ฌ์–ด์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
echo "[$NOW] [INFO] ํ˜„์žฌ ์šด์˜ ์ค‘์ธ Docker Container ์ •๋ณด : "
echo "[$NOW] [INFO] ํ˜„์žฌ ์šด์˜ ์ค‘์ธ Docker Container ์ •๋ณด : " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
echo "[$NOW] [INFO] ${operationDockerStatus} "
echo "[$NOW] [INFO] ${operationDockerStatus} " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
echo -e "=====================================================================================================\n"
echo -e "=====================================================================================================\n" >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

 

๋„์ปค ๊ธฐ๋™ ์‰˜ ์Šคํฌ๋ฆฝํŠธ๋Š” ์œ„์™€ ๊ฐ™์ด ์ค€๋น„ํ•ด ๋ณด์•˜์–ด์š”.


 

 

        ๐Ÿ“ฆ applicationOldDockerContainerRemove()

applicationContainerNewRun.sh 43 ~ 77๋ฒˆ์งธ ์ค„

๋ฐ˜์‘ํ˜•


Log ๋””๋ ‰ํ† ๋ฆฌ ์กฐํšŒ ๊ด€๋ จ ํ•จ์ˆ˜๋™์ž‘์ด ๋๋‚˜๊ณ  ๋‚˜๋ฉด ์œ„ ํ•จ์ˆ˜๋ฅผ ํ˜ธ์ถœํ•˜๊ฒŒ ๋˜๋Š”๋ฐ,
์ด ํ•จ์ˆ˜๋Š” ๊ธฐ์กด์— ์žˆ๋˜ ๋„์ปค ์ปจํ…Œ์ด๋„ˆ๋ฅผ ์ค‘์ง€ํ•˜๊ณ , ์‚ญ์ œํ•˜๋Š” ์ž‘์—…์„ ๋งก๊ณ  ์žˆ์–ด์š”.

์ตœ์ดˆ Application Docker Container ๊ฐœ์ˆ˜๊ฐ€ ๋‘ ๊ฐœ ์ด๊ธฐ ๋•Œ๋ฌธ์— ๋ฐ˜๋ณต๋ฌธ์„ ๋‘ ๋ฒˆ ๋Œ๋ฆฌ๊ฒŒ ๋˜๊ณ , ์ฒซ๋ฒˆ์งธ ๋ฐ˜๋ณต๋ฌธ์ผ ๊ฒฝ์šฐ 49๋ฒˆ์งธ if๋ฌธ ์กฐ๊ฑด์— ํ•ฉ๋‹นํ•˜์—ฌ ๋ช…๋ น์–ด์— ์‚ฌ์šฉ๋  ๋ณ€์ˆ˜๊ฐ€

SUB ์ปจํ…Œ์ด๋„ˆ์— ๋งž๊ฒŒ ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„, ์™ธ๋ถ€ ํฌํŠธ ๋ฒˆํ˜ธ, ์ปจํ…Œ์ด๋„ˆ ID๊ฐ€ ๊ฐ๊ฐ์˜ ๋ณ€์ˆ˜์— ๋“ค์–ด ๊ฐˆ ์ˆ˜ ์žˆ๋„๋ก ํ•ด ์ฃผ์—ˆ๊ณ ,

๋‘๋ฒˆ์งธ ๋ฐ˜๋ณต๋ฌธ์ด๋ผ๋ฉด
MAIN ์ปจํ…Œ์ด๋„ˆ์— ๋งž๊ฒŒ ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„, ์™ธ๋ถ€ ํฌํŠธ ๋ฒˆํ˜ธ, ์ปจํ…Œ์ด๋„ˆ ID๊ฐ€ ๊ฐ๊ฐ์˜ ๋ณ€์ˆ˜์— ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋„๋ก ์ฒ˜๋ฆฌํ•ด ์ฃผ์—ˆ์–ด์š”.



์ฐธ๊ณ ๋กœ ์ฒซ๋ฒˆ์งธ ๋ฐ˜๋ณต๋ฌธ์—์„œ SUB ์ปจํ…Œ์ด๋„ˆ ์ •๋ณด๋ถ€ํ„ฐ ๋„ฃ๋Š” ์ด์œ ๋Š” ๊ธฐ๋™ ์ค‘์ธ ์ƒํƒœ์ผ ๋•Œ, 
MAIN์ด ๋งจ ๋งˆ์ง€๋ง‰์— ์ตœ์‹ ํ™” ์ž‘์—…์ด ์ด๋ค„์งˆ ์ˆ˜ ์žˆ๋„๋ก SUB ์ปจํ…Œ์ด๋„ˆ๋ถ€ํ„ฐ ์ž‘์—…์„ ํ•˜๊ฒŒ ํ•ด ์ฃผ์—ˆ์–ด์š”.



applicationContainerNewRun.sh 79 ~ 105๋ฒˆ์งธ ์ค„


79๋ฒˆ์งธ ์ค„์—์„œ ๋„์ปค ์ค‘์ง€๋ฅผ ์œ„ํ•ด ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ด ์ฃผ์—ˆ๊ณ ,
์œ„ if๋ฌธ์—์„œ ๋ถ„๊ธฐ์ฒ˜๋ฆฌ ๋˜์–ด ๋‹ด๊ธด ์ค‘์ง€ ๋Œ€์ƒ ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„ ๋ณ€์ˆ˜๊ฐ’์„ ๋„ฃ์–ด ์ฃผ์—ˆ์–ด์š”.

๋งŒ์•ฝ ์œ„ ๋ช…๋ น์–ด๊ฐ€ ๋™์ž‘ ์‹คํŒจํ•˜๊ฒŒ ๋˜๋ฉด ๋ฐ”๋กœ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ข…๋ฃŒํ•˜๊ฒŒ ๋˜๊ณ , applicationContainerExistenceStatusCheck.sh๋กœ ๋„˜์–ด ๊ฐ€
ํ•ด๋‹น ์‰˜ ์Šคํฌ๋ฆฝํŠธ ํ˜ธ์ถœ ์ด ํ›„์— Line์„ ์ฒ˜๋ฆฌํ•˜๊ฒŒ ๋  ๊ฑฐ์—์š”.

79๋ฒˆ์งธ ๋ช…๋ น์–ด๊ฐ€ ์„ฑ๊ณตํ•˜๊ฒŒ ๋˜๋ฉด ์ปจํ…Œ์ด๋„ˆ๋Š” ์ค‘์ง€ ๋œ ์ƒํƒœ๊ฐ€ ๋˜๊ณ , ์ด์ œ ์‚ญ์ œํ•  ์ˆ˜ ์žˆ๋Š” ์ƒํƒœ๊ฐ€ ๋œ ๊ฒƒ์ด์—์š”.


๊ทธ๋ž˜์„œ 91๋ฒˆ์งธ ์ค„์—์„œ docker rm ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์‚ญ์ œํ•˜๊ณ , ์‹คํŒจํ•˜๋ฉด ์Šคํฌ๋ฆฝํŠธ ์ข…๋ฃŒ ์„ฑ๊ณตํ•˜๋ฉด applicationDockerContanerRun() ์„ ํ˜ธ์ถœํ•˜๋Š”๋ฐ, ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„์„ ๋งค๊ฐœ ๋ณ€์ˆ˜๋กœ ์ „๋‹ฌํ•˜๊ฒŒ ํ•ด ์ฃผ์—ˆ์–ด์š”.

๊ทธ๋ž˜์„œ ์ค‘์ง€ ๋ฐ ์‚ญ์ œ๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด ๋ฐ”๋กœ ๊ธฐ๋™ ์ž‘์—…์„ ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๊ฒŒ ์ฒ˜๋ฆฌํ•ด ์ฃผ์—ˆ์–ด์š”.







        ๐Ÿ“ฆ applicationDockerContainerRun()

applicationContainerNewRun.sh 108 ~ 122๋ฒˆ์งธ ์ค„


์œ„ ํ•จ์ˆ˜๋Š” ๋งค๊ฐœ ๋ณ€์ˆ˜๋กœ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋„์ปค ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„์„ ๋ฐ›๊ณ  ์žˆ์–ด์š”.
์ด๋ฅผ 108๋ฒˆ์งธ ์ค„์—์„œ containerName ์ด๋ผ๋Š” ๋ณ€์ˆ˜๋กœ ์˜ฎ๊ฒจ์ฃผ์—ˆ์–ด์š”.

114๋ฒˆ์งธ ์ค„์—์„œ ๊ธฐ๋™ํ•  ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„์ด MAIN ์ธ์ง€ SUB์ธ์ง€๋ฅผ ํ™•์ธํ•˜๊ณ ,

๊ทธ์— ๋”ฐ๋ฅธ ์ง€์—ญ ๋ณ€์ˆ˜์— ๊ฐ๊ฐ์˜ ๊ฐ’์„ ๋„ฃ์–ด ์ฃผ์—ˆ์–ด์š”.

applicationContainerNewRun.sh 131 ~ 170๋ฒˆ์งธ ์ค„

728x90


๋ณธ๊ฒฉ์ ์œผ๋กœ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋„์ปค ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๊ธฐ๋™ํ•˜๊ณ , ์ž˜ ๊ธฐ๋™ ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๋ถ€๋ถ„์ด์—์š”.

133๋ฒˆ์งธ ์ค„์—์„œ ๋ช…๋ น์–ด๊ฐ€ ์ œ๋Œ€๋กœ ์ฒ˜๋ฆฌ๊ฐ€ ๋˜์—ˆ๋Š”์ง€๋ฅผ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด if ๋ฌธ ์•ˆ์— ๋„์ปค ๊ธฐ๋™ ๋ช…๋ น์–ด๋ฅผ ์ž‘์„ฑํ•ด ์ฃผ์—ˆ์–ด์š”.


๐Ÿ’ก ์ฐธ๊ณ  ์‚ฌํ•ญ
Docker ๋ช…๋ น์–ด

docker run: Docker Container ์‹คํ–‰ ๋ช…๋ น

Option

-- itd: Docker Container๋ฅผ ๋Œ€ํ™”ํ˜•์œผ๋กœ ์‹คํ–‰ํ•˜๊ณ , ํ„ฐ๋ฏธ๋„์— ์—ฐ๊ฒฐํ•œ ๋’ค Back Ground์—์„œ ์‹คํ–‰.
-- name: Docker Container ์ด๋ฆ„ ์„ค์ •.
-- hostname: Docker Container ๋‚ด๋ถ€ Host ์ด๋ฆ„ ์„ค์ •.
- e container: Docker Container ๋‚ด์—์„œ container๋ผ๋Š” ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ docker๋กœ ์„ค์ •.
- p: :์„ ๊ธฐ์ค€์œผ๋กœ ์•ž์—๋Š” Host Server์˜ Port ๋ฒˆํ˜ธ์™€ ๋’ค์—๋Š” Docker Container ๋‚ด๋ถ€ ํฌํŠธ ๋ฒˆํ˜ธ Mapping.
--restart unless-stopped: Container๊ฐ€ ๋น„์ •์ƒ์ ์œผ๋กœ ์ข…๋ฃŒ๋œ ๊ฒฝ์šฐ์—๋งŒ ์žฌ์‹œ์ž‘. ๋ช…์‹œ์ ์œผ๋กœ ์ค‘์ง€๋  ๋•Œ๊นŒ์ง€ Container ์‹คํ–‰.

์ถ”๊ฐ€ Option

-- privileged: Docker Container์˜ ํŠน๊ถŒ ๋ชจ๋“œ๋ฅผ ๋ถ€์—ฌํ•˜์—ฌ Container๊ฐ€ Host ์‹œ์Šคํ…œ์˜ ๋ชจ๋“  ๊ธฐ๋Šฅ์— Access ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•จ. ์ผ๋ฐ˜์ ์œผ๋กœ ๋ณด์•ˆ์ ์ธ ์ด์œ ๋กœ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๊ฒƒ์„ ๊ถŒ๊ณ .


๋งŒ์•ฝ ์œ„ ๋ช…๋ น์–ด๊ฐ€ ์‹คํŒจ ํ•˜๊ฒŒ ๋˜๋ฉด failedCommand() ๊ฐ€ ์‹คํ–‰๋˜๊ณ ,
์Šคํฌ๋ฆฝํŠธ๋Š” ์ข…๋ฃŒ ๋˜์–ด ํ˜ธ์ถœํ–ˆ๋˜ ์‰˜ ์Šคํฌ๋ฆฝํŠธ๋กœ ๋Œ์•„๊ฐˆ ๊ฑฐ์—์š”.


์„ฑ๊ณตํ–ˆ๋‹ค๋ฉด 139๋ฒˆ์งธ ์ค„์—์„œ ํ•ด๋‹น ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„์„ ๊ฐ€์ง€๊ณ ,
์ปจํ…Œ์ด๋„ˆ ID๋ฅผ ์กฐํšŒํ•œ ๋’ค ๊ทธ ๊ฒฐ๊ณผ๋ฅผ containerId ๋ณ€์ˆ˜์— ๋‹ด์•„์ค๋‹ˆ๋‹ค.


๊ทธ๋Ÿฐ ๋’ค ํ•ด๋‹น ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์ž‘๋™ํ•˜๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด 148๋ฒˆ์งธ ์ค„์—์„œ ์ปจํ…Œ์ด๋„ˆ ID๋ฅผ ํ†ตํ•ด ๊ธฐ๋™ ์ƒํƒœ๊ฐ’์„ ํ™•์ธํ•˜์—ฌ ๊ทธ ๊ฒฐ๊ณผ๋ฅผ checkContainerStatus ๋ณ€์ˆ˜์— ๋‹ด์•„ ์ฃผ์—ˆ์–ด์š”.

152๋ฒˆ์งธ ์ค„์—์„œ๋Š” ๋ˆˆ์œผ๋กœ ์ปจํ…Œ์ด๋„ˆ ๊ธฐ๋™ ์ƒํƒœ๋ฅผ ๋ณด๋‹ค ์ž์„ธํžˆ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด docker logs ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ํ•ด๋‹น ์ปจํ…Œ์ด๋„ˆ์˜ ๊ธฐ๋™ Log๊ฐ€ ์ถœ๋ ฅ๋˜๋„๋ก ํ•ด ์ฃผ์—ˆ์–ด์š”. 

154๋ฒˆ์งธ ์ค„์—์„œ ํ•ด๋‹น ์ปจํ…Œ์ด๋„ˆ์˜ ๊ธฐ๋™ ์ƒํƒœ ๊ฐ’์ด Up์œผ๋กœ ์‹œ์ž‘ํ•œ๋‹ค๋ฉด
์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๊ธฐ๋™ ๋˜๊ณ  ์žˆ๋Š” ๊ฑธ ํ™•์ธํ•˜๋Š” ๊ฒƒ์ด๊ณ ,

์•„๋‹ˆ๋ผ๋ฉด ์‹คํŒจํ–ˆ๋‹ค๋Š” ๋‚ด์šฉ์„ console๊ณผ ๋กœ๊ทธ์— ์ €์žฅ ๋ฐ ์ถœ๋ ฅ๋˜๋„๋ก ํ•ด ์ฃผ์—ˆ์–ด์š”.



applicationContainerNewRun.sh 189 ~ 199๋ฒˆ์งธ ์ค„


์œ„์˜ ์ž‘์—…์ด ๋๋‚˜๋ฉด ์ด ๊ณณ์œผ๋กœ ์™€์„œ ๋„์ปค ์ปจํ…Œ์ด๋„ˆ ๊ธฐ๋™์ƒํƒœ ๋ฐ ํ•„์š”ํ•œ ์ •๋ณด๋“ค์„ ์ฝ˜์†”๊ณผ ๋กœ๊ทธ๋กœ ์ถœ๋ ฅ ๋ฐ ์ €์žฅํ•˜๊ณ ,
ํ•ด๋‹น ์‰˜ ์Šคํฌ๋ฆฝํŠธ๋Š” ์ข…๋ฃŒ๋œ ๋’ค ์Šคํฌ๋ฆฝํŠธ๋ฅผ ํ˜ธ์ถœํ–ˆ๋˜ ์‰˜ ์Šคํฌ๋ฆฝํŠธ๋กœ ๋Œ์•„๊ฐ€๊ฒŒ ๋œ๋‹ต๋‹ˆ๋‹ค.


์ด๋ฒˆ ๊ธ€์—๋Š” ์—ฌ๊ธฐ๊นŒ์ง€ ์ •๋ฆฌํ•˜๊ณ ,
๋‹ค์Œ ๊ธ€์—์„œ๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋„์ปค์˜ ๊ธฐ๋™ ์ƒํƒœ ๋ฐ Health Check ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์ •๋ฆฌํ•ด ๋ณผ๊ฒŒ์š”.
 



 

๋„์ปค ๊ต๊ณผ์„œ:์„ค์น˜๋ถ€ํ„ฐ ์‹ค์ „ ์šด์˜ ํˆฌ์ž…๊นŒ์ง€ ํ•œ ๊ถŒ์— ๋‹ด์•˜๋‹ค!

COUPANG

www.coupang.com

"์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค."

 



์ด์ „ ๊ธ€: [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ข Application Server Docker Job (โ‘  Application ๋„์ปค ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธ)

๋‹ค์Œ ๊ธ€: [CI/CD] Jenkins + Docker๋ฅผ ์ด์šฉํ•œ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ - โ‘ข Application Server Docker Job (โ‘ข Application Docker Health Check)



 

 

 

 

728x90
๋ฐ˜์‘ํ˜•