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

2023. 7. 6. 19:18ใ†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

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

 

 

 

 

๐Ÿš€ NGINX Docker ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธ

    ๐Ÿ”ฝ ๊ฐœ์š”

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

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

728x90

 

deploy Directory Path

 

 

 

 

        ๐Ÿ“ฆ ์†Œ๊ฐœ

์ง€๋‚œ ๊ธ€์—์„œ NGINX ์„ค์ •์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์•˜์–ด์š”.

์ด๋ฒˆ ๊ธ€์—์„œ๋Š” NGINX ๋„์ปค๊ฐ€ ์กด์žฌํ•˜๋Š”์ง€ ํ™•์ธํ•˜๋Š” ์‰˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๋งŒ๋“ค์–ด ๋ณด๋ ค๊ณ ํ•ด์š”.

์ฐธ๊ณ ๋กœ Application Docker Run Target Server์™€ NGINX Docker Run Target Server๊ฐ€ ๋‹ค๋ฅด๊ณ , ์ด๋ ‡๊ฒŒ ํ•œ ์ด์œ ๋Š” ํ•ด๋‹น Application์€ ์‹ค์ œ ์™ธ๋ถ€๋ž‘ ์ง์ ‘ ํ†ต์‹ ํ•ด์•ผ ํ•˜๋Š” ์„œ๋น„์Šค๊ฐ€ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์™ธ๋ถ€๋ง๊ณผ NAT๋ฅผ ํ†ตํ•ด ์ง์ ‘ ํ†ต์‹ ํ•  ์ˆ˜ ์žˆ๋Š” Server์—์„œ ๋‚ด๋ถ€๋ง์— ์œ„์น˜ํ•œ Application Server์— Reverse Proxy๊ฐ€ ๊ฐ€๋Šฅํ•˜๋„๋ก ํ•˜๊ธฐ ์œ„ํ•จ์ด์—์š”.

 

 

    ๐Ÿ”ฝ nginxContainerExistenceStatusCheck.sh

#!/bin/bash

set -e

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

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

NGINX_CONTAINER_NAME="nginx-total-back-office"

NGINX_SHELL_SCRIPT_DIRECTORY="/data/deploy/giggal-total-back-office/deploy/prod/nginx/shell-script"

NGINX_CONTAINER_NAME="nginx-total-back-office"

checkLogDirectory() {
  sleep 5

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

  if [ -d "$LOG_DIR" ];
  then
    echo "[INFO] ๊ธฐ๊น”๋‚˜๋Š” ์‚ฌ๋žŒ๋“ค ํ†ตํ•ฉ ๊ด€๋ฆฌ ์„œ๋ฒ„ API ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ ์„œ๋ฒ„ ์ž‘์—… ์ค‘ NGINX Docker Container ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธ ์ž‘์—…์ด ์‹œ์ž‘ ๋˜์—ˆ์–ด์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
    echo "======================================[$NOW] ํ†ตํ•ฉ ๋ฐฑ ์˜คํ”ผ์Šค api NGINX Docker Container ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธ======================================" >> $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

  checkNginxContainerExistenceStatus
}

checkNginxContainerExistenceStatus() {
  echo "[$NOW] [INFO] ${NGINX_CONTAINER_NAME} ์ปจํ…Œ์ด๋„ˆ ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธํ• ๊ฒŒ์š”."
  echo "[$NOW] [INFO] ${NGINX_CONTAINER_NAME} ์ปจํ…Œ์ด๋„ˆ ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธํ• ๊ฒŒ์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

  NGINX_DOCKER_STATUS=$(docker ps -aqf "name=$NGINX_CONTAINER_NAME")

  if [[ -z "$NGINX_DOCKER_STATUS" ]];
  then

    echo "[$NOW] [INFO] ${NGINX_CONTAINER_NAME} Container ์กด์žฌํ•˜์ง€ ์•Š์•„์š”."
    echo "[$NOW] [INFO] ${NGINX_CONTAINER_NAME} Container ์กด์žฌํ•˜์ง€ ์•Š์•„์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

    $NGINX_SHELL_SCRIPT_DIRECTORY/nginxDockerContainerRun.sh;

  else
    echo "[$NOW] [INFO] ${NGINX_CONTAINER_NAME} ์ปจํ…Œ์ด๋„ˆ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค."
    echo "[$NOW] [INFO] ${NGINX_CONTAINER_NAME} ์ปจํ…Œ์ด๋„ˆ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

    checkNginxStatus
  fi
}

checkNginxStatus() {
    echo "[$NOW] [INFO] Nginx ์ปจํ…Œ์ด๋„ˆ ๋™์ž‘ ์—ฌ๋ถ€ ํ™•์ธํ• ๊ฒŒ์š”."
    echo "[$NOW] [INFO] Nginx ์ปจํ…Œ์ด๋„ˆ ๋™์ž‘ ์—ฌ๋ถ€ ํ™•์ธํ• ๊ฒŒ์š”." >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

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

    sleep 5

    containerLogs=$(docker logs "$containerId")

    if [[ $checkContainerStatus == "Up"* ]];
    then
      echo "[$NOW] [INFO] ๊ธฐ๋™ ์ค‘์ธ ${NGINX_CONTAINER_NAME} Container ๋‚ด๋ถ€ Log ์ •๋ณด : "
      echo "[$NOW] [INFO] ๊ธฐ๋™ ์ค‘์ธ ${NGINX_CONTAINER_NAME} Container ๋‚ด๋ถ€ Log ์ •๋ณด : " >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1
      echo -e "[$NOW] [INFO] $containerLogs \n"
      echo -e "[$NOW] [INFO] $containerLogs \n" >> $LOG_DIR/"$SAVE_LOG_DATE"-deploy.log 2>&1

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

    $NGINX_SHELL_SCRIPT_DIRECTORY/nginxServiceSetting.sh;

    else
      echo "[$NOW] [ERROR] ๋ฌธ์ œ ๋ฐœ์ƒํ•œ ${NGINX_CONTAINER_NAME} Container ๋‚ด๋ถ€ Log ์ •๋ณด : "
      echo "[$NOW] [ERROR] ๋ฌธ์ œ ๋ฐœ์ƒํ•œ ${NGINX_CONTAINER_NAME} 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

      nginxDockerContainerRemove
    fi
}

nginxDockerContainerRemove() {

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

  stopContainerId=$(docker ps --filter "name=$NGINX_CONTAINER_NAME" --format "{{.ID}}")

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

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

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

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

      $NGINX_SHELL_SCRIPT_DIRECTORY/nginxDockerContainerRun.sh;
    fi
  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 ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ ์ž‘์—… ์ค‘ NGINX Docker Container ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธ ์ž‘์—…์ด ๋๋‚ฌ์–ด์š”."
echo "[$NOW] [INFO] ๊ธฐ๊น”๋‚˜๋Š” ์‚ฌ๋žŒ๋“ค ํ†ตํ•ฉ ๊ด€๋ฆฌ ์„œ๋ฒ„ API ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ LOG ์œ„์น˜ : ${LOG_DIR}"
echo "[$NOW] [INFO] ๊ธฐ๊น”๋‚˜๋Š” ์‚ฌ๋žŒ๋“ค ํ†ตํ•ฉ ๊ด€๋ฆฌ ์„œ๋ฒ„ API ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ ์ž‘์—… ์ค‘ NGINX 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
๋ฐ˜์‘ํ˜•


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


 

 

 

๐Ÿง ์ฐธ๊ณ  ์ž๋ฃŒ

 

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

๐Ÿ—‚ ๋ชฉ์ฐจ โœ… [CI/CD] Jenkins์™€ Gitea ์—ฐ๋™ โœ… [CI/CD] Jenkins Trigger ์ •๋ณด Discord๋กœ ๋ณด๋‚ด๊ธฐ โœ… [CI/CD] ์ •์  ์ฝ”๋“œ ๋ถ„์„ ํˆด SonarQube์™€ Jenkins ์—ฐ๋™ โœ… [CI/CD] SonarQube๋ฅผ ํ†ตํ•ด Code Convention ์ ์šฉ โœ… [DevOps] JAVA Gradle JaCoCo

junyharang.tistory.com

 

 

 

NGINX ์ฟก๋ถ : 115๊ฐ€์ง€ ๋ ˆ์‹œํ”ผ๋กœ ๋ฐฐ์šฐ๋Š” ๊ณ ์„ฑ๋Šฅ ๋ถ€ํ•˜๋ถ„์‚ฐ ๋ณด์•ˆ ์„œ๋ฒ„ ๋ฐฐํฌ์™€ ๊ด€๋ฆฌ 2ํŒ

COUPANG

www.coupang.com

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

 

 

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

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

 

 

 

 

 

 

728x90
๋ฐ˜์‘ํ˜•