Skip to content

Commit

Permalink
๐Ÿž BugFix : ๏ฟฝdev ์„œ๋ฒ„ ๋ณต๊ตฌ (#121)
Browse files Browse the repository at this point in the history
* fix:backcicd.yaml ๋„์ปค ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋‚ด๋ฆฌ๊ณ  ๋‹ค์‹œ ์˜ฌ๋ฆฌ๋„๋ก ๋ณ€๊ฒฝํ•จ

* fix:backcicd.yaml ๋„์ปค ์ปดํฌ์ฆˆ yml ์—์„œ yaml ์ˆ˜์ •

* fix:backcicd.yaml ๋„์ปค ์ปดํฌ์ฆˆ yml ์—์„œ yaml ์ˆ˜์ •

* fix:backcicd.yaml ์ฃผ์„์˜ค๋ฅ˜ ์ˆ˜์ •

* fix:backcicd.yaml ์ฃผ์„์˜ค๋ฅ˜ ์ˆ˜์ •2

* fix:backcicd.yaml dev1 ํƒœ๊ทธ์—์„œ test ๋กœ ๋ณ€๊ฒฝ

* fix:backcicd.yaml ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง

* fix:backcicd.yaml ์•„ํ‚คํ…์ฒ˜ ๊ตฌ์กฐ์— ๋งž๊ฒŒ ํ• ๋‹น ์ธ์Šคํ„ด์Šค ๋ณ€๊ฒฝ

* fix:backcicd.yaml ์ ์šฉ ๋ธŒ๋žœ์น˜ ๋ณ€๊ฒฝ

* fix:backcicd.yaml ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ˆ˜์ •

* fix:backcicd.yaml ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ˆ˜์ •2

* fix:backcicd.yaml ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ˆ˜์ •3

* fix:backcicd.yaml ๊ฐ ๋ชจ๋“ˆ๋ณ„ jobs ๋กœ ๋ถ„๋ฆฌ

* fix:backcicd.yaml ๋ฉค๋ฒ„๋ชจ๋“ˆ ํ…Œ์ŠคํŠธ

* fix:backcicd.yaml ๋ฐ ๊ฐ ๋„์ปคํŒŒ์ผ์— ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๋„ฃ์–ด์„œ ์‹คํ–‰ ํ…Œ์ŠคํŠธ

* fix:backcicd.yaml ์ „์ฒด๋ชจ๋“ˆ ์‹คํ–‰ ํ…Œ์ŠคํŠธ

* fix:backcicd.yaml ์ „์ฒด๋ชจ๋“ˆ ์‹คํ–‰ ํ…Œ์ŠคํŠธ ๋„์ปคํŒŒ์ผ ๋Œ€๋ฌธ์ž๋กœ ๋ณ€๊ฒฝ

* fix:backcicd.yaml json ํŒŒ์‹ฑ์œผ๋กœ ๋ณ€๊ฒฝ

* fix:backcicd.yaml json ํŒŒ์‹ฑ์œผ๋กœ ๋ณ€๊ฒฝ2

* fix:backcicd.yaml json ํŒŒ์‹ฑ์œผ๋กœ ๋ณ€๊ฒฝ3

* fix:backcicd.yaml json ํŒŒ์‹ฑ์œผ๋กœ ๋ณ€๊ฒฝ4

* fix:backcicd.yaml json ํŒŒ์‹ฑ์œผ๋กœ ๋ณ€๊ฒฝ5

* fix:backcicd.yaml ํŒŒ์ผ๋ช… ์ˆ˜์ •

* fix:backcicd.yaml ๋„์ปคํŒŒ์ผ ๊ฒฝ๋กœ ์ˆ˜์ •

* fix:backcicd.yaml ๋„์ปคํŒŒ์ผ ๊ฒฝ๋กœ ์ˆ˜์ •2

* fix:backcicd.yaml ec2์— .env ์ฃผ์ž…

* fix:backcicd.yaml ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ˆ˜์ •, ์•ฑ๋‹จ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์˜ค๋ฅ˜ ์ˆ˜์ •

* fix:๋„์ปคํŒŒ์ผ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๊ด€๋ จ ์„ค์ •

* fix: member ๋„ env ์•ˆ๋ณต์‚ฌํ•˜๊ฒŒ ๋ฐ”๊ฟˆ

* fix: ๋„์ปคํŒŒ์ผ ๋ณต๊ตฌ

* fix: ๋„์ปคํŒŒ์ผ ๋ณ€ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๊ฒฝ

* fix: ๋„์ปคํŒŒ์ผ ๋ณ€ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๊ฒฝ2

* fix: ๋นŒ๋“œํƒ€์ž„-> ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ฃผ์ž… ๋ฐฉ์‹์œผ๋กœ ๋ณ€๊ฒฝ

* fix: ๋„์ปค์ปดํฌ์ฆˆ ์ˆ˜์ •

* fix: ๋„์ปค์ปดํฌ์ฆˆ ์ˆ˜์ •2

* fix: ๋„์ปค์ปดํฌ์ฆˆ ์ˆ˜์ •3

* fix: ๋„์ปค์ปดํฌ์ฆˆ ์ˆ˜์ •4

* fix: ๋„์ปค์ปดํฌ์ฆˆ ์ˆ˜์ •5

* fix: ๋„์ปค์ปดํฌ์ฆˆ ์ˆ˜์ •6

* fix: ์ ์šฉ๋ธŒ๋žœ์น˜ ์ˆ˜์ •

* fix: ์ ์šฉ๋ธŒ๋žœ์น˜ ์ˆ˜์ •2

* feat: ์•Œ๋ฆผ,์ฑ„ํŒ… ๋ชจ๋“ˆ ์ถ”๊ฐ€

* fix: ๋นŒ๋” ๋„์ปคํŒŒ์ผ ๋ณ€๊ฒฝ

* fix: ๋นŒ๋” ๋„์ปคํŒŒ์ผ ์‹คํ–‰ ์ˆœ์„œ ๋ณ€๊ฒฝ

* fix: ํ…Œ์ŠคํŠธ์šฉ ์ปค๋ฐ‹

* fix: cicd ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€

* fix: cicd ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€ 2

* fix: cicd ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€ 3

* fix: cicd ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€ 4

* fix: cicd ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€ 5

* fix: ์นดํ”„์นด ํŒŒ์‹ฑ ์ˆ˜์ •

* fix: ์นดํ”„์นด ํŒŒ์‹ฑ ์ˆ˜์ • 2

* fix: ์นดํ”„์นด ํŒŒ์‹ฑ ์ˆ˜์ • 3

* fix: ์ตœ์‹ ์ปค๋ฐ‹ ๋กค๋ฐฑ

* fix: ๋„์ปค์ปดํฌ์ฆˆ ์„œ๋น„์Šค ์ถ”๊ฐ€

* fix: ์ ์šฉ ๋ธŒ๋žœ์น˜ ๋ณ€๊ฒฝ

* fix: ๋ฃจํŠธ ๋„์ปคํŒŒ์ผ ์ˆ˜์ •

* fix: ๋ฃจํŠธ ๋„์ปคํŒŒ์ผ ์ˆ˜์ •2

* fix: ๋ฃจํŠธ ๋„์ปคํŒŒ์ผ ์ˆ˜์ • 3

* fix: ๋ฃจํŠธ ๋„์ปคํŒŒ์ผ ์ˆ˜์ • 4

* fix: ๋ฃจํŠธ ๋„์ปคํŒŒ์ผ ์ˆ˜์ • 5

* fix: cicd ํŒŒ์ดํ”„๋ผ์ธ ๊ฐœ์„ (๋นŒ๋“œ ๋ฐฉ์‹)

* fix: ๋ณ€๊ฒฝ๋œ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ๋ฐ˜์˜ ํ…Œ์ŠคํŠธ

* fix: ๋ณ€๊ฒฝ๋œ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ๋ฐ˜์˜ ํ…Œ์ŠคํŠธ 2

* fix: ๋ณ€๊ฒฝ๋œ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ๋ฐ˜์˜ ํ…Œ์ŠคํŠธ 3

* fix: ๋ณ€๊ฒฝ๋œ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ๋ฐ˜์˜ ํ…Œ์ŠคํŠธ 4

* fix: ๋ณ€๊ฒฝ๋œ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ๋ฐ˜์˜ ํ…Œ์ŠคํŠธ 4

* feat : prod/dev ์šฉ ์  ํ‚จ์ŠคํŒŒ์ผ
fix : ๊ฐ ๋ชจ๋“ˆ๋ณ„ ๋„์ปคํŒŒ์ผ ์  ํ‚จ์Šค์— ๋งž๊ฒŒ ์ˆ˜์ •

* feat : prod/dev ์šฉ ์  ํ‚จ์ŠคํŒŒ์ผ
fix : ๊ฐ ๋ชจ๋“ˆ๋ณ„ ๋„์ปคํŒŒ์ผ ์  ํ‚จ์Šค์— ๋งž๊ฒŒ ์ˆ˜์ •
delete : github actions ํŒŒ์ผ

* feat : prod/dev ์šฉ ์  ํ‚จ์ŠคํŒŒ์ผ
fix : ๊ฐ ๋ชจ๋“ˆ๋ณ„ ๋„์ปคํŒŒ์ผ ์  ํ‚จ์Šค์— ๋งž๊ฒŒ ์ˆ˜์ •
delete : github actions ํŒŒ์ผ
์  ํ‚จ์ŠคํŒŒ์ผ์€ ํŒŒ์ดํ”„๋ผ์ธ์—์„œ ์‹คํ–‰

* fix: ๋„์ปคํŒŒ์ผ gradle ๋ฏธ๋ฐ˜์˜ ์ˆ˜์ •

* fix: ๋„์ปคํŒŒ์ผ gradle ๋ฏธ๋ฐ˜์˜ ์ˆ˜์ •2

* fix: ์  ํ‚จ์Šค ๋นŒ๋” ํ‘ธ์‹œ ์•ˆํ•˜๊ฒŒ ํ•จ.

* fix: ์  ํ‚จ์Šค ์ด๋ฏธ์ง€ ์ •๋ฆฌํ•˜๊ฒŒ ํ•จ.

* fix: ecr ์ด๋ฏธ์ง€๋กœ ๋ณ€๊ฒฝ ํ…Œ์ŠคํŠธ

* fix: ๊ฐ ๋ชจ๋“ˆ ๋„์ปคํŒŒ์ผ ecr ๊ฒฝ๋กœ๋กœ ๋ณ€๊ฒฝ
tag:test->dev ๋ณ€๊ฒฝ
delete: chat ๋ชจ๋“ˆ ๋„์ปคํŒŒ์ผ

* fix: ๋„์ปคํŒŒ์ผ ๋นŒ๋” ์ด๋ฏธ์ง€ ์ฐธ์กฐ ๋ฐฉ์‹ ์ˆ˜์ •

* fix: ๋„์ปคํŒŒ์ผ ๋นŒ๋” ์ด๋ฏธ์ง€ ์ฐธ์กฐ ๋ฐฉ์‹ ์ˆ˜์ • 2

* fix: ๋„์ปคํŒŒ์ผ ๋นŒ๋” ์ด๋ฏธ์ง€ ์ฐธ์กฐ ๋ฐฉ์‹ ์ˆ˜์ • 3

* fix: ๋„์ปคํŒŒ์ผ ๋นŒ๋” ์ด๋ฏธ์ง€ ์ฐธ์กฐ ๋ฐฉ์‹ ์ˆ˜์ • 4

* fix: ๋„์ปคํŒŒ์ผ ๋นŒ๋” ์ด๋ฏธ์ง€ ์ฐธ์กฐ ๋ฐฉ์‹ ์ˆ˜์ • 5

* fix: ๋„์ปคํŒŒ์ผ ๋””๋ฒ„๊น… ์ถ”๊ฐ€

* fix: ๋„์ปคํŒŒ์ผ ๋Ÿฐํƒ€์ž„๋•Œ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์•ˆ ์ฝ๋„๋ก ๋ณ€๊ฒฝ

* fix: ๋„์ปคํŒŒ์ผ ๋Ÿฐํƒ€์ž„๋•Œ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์•ˆ ์ฝ๋„๋ก ๋ณ€๊ฒฝ 2

* fix: develop ๋ธŒ๋žœ์น˜์— ์ ์šฉ๋˜๋„๋ก ํ•จ

* fix: dev ์šฉ ์  ํ‚จ์Šค

* ๋นŒ๋” ๋นŒ๋“œ ์ „ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ํ™•์ธ

* fix: ์ • ์ƒ ํ™” ! !! !

* fix: dev ํƒœ๊ทธ ๋„ฃ์Œ

* fix: ์–ด์ด์—†๋Š” ์‹ค์ˆ˜

* fix: ์ ์šฉ ๋ธŒ๋žœ์น˜ dev ๋กœ ์ˆ˜์ •

---------

Co-authored-by: aida <[email protected]>
  • Loading branch information
yoonseopkim and ghk01214 authored Dec 28, 2024
1 parent 64ad7fd commit 6767f12
Show file tree
Hide file tree
Showing 11 changed files with 723 additions and 246 deletions.
443 changes: 287 additions & 156 deletions Jenkinsfile

Large diffs are not rendered by default.

176 changes: 176 additions & 0 deletions Jenkinsfile-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
pipeline {
agent any

environment {
AWS_REGION = 'ap-northeast-2'
ECR_REGISTRY = credentials('ecr-registry')
DISCORD_CI_WEBHOOK = credentials('dev-discord-ci-webhook')
DISCORD_CD_WEBHOOK = credentials('dev-discord-cd-webhook')
DOCKER_TAG = 'dev'
}

stages {
stage('์†Œ์Šค์ฝ”๋“œ ์ฒดํฌ์•„์›ƒ') {
steps {
script {
deleteDir()
git branch: 'develop',
url: 'https://github.com/KTB-Sixmen/gitfolio_back_spring.git'
}
}
}

stage('ํ™˜๊ฒฝ ์„ค์ •') {
steps {
script {
def envFile = '/var/lib/jenkins/environments/.env.back.dev'
if (fileExists(envFile)) {
sh """
cp ${envFile} .env
echo 'ํ™˜๊ฒฝ ํŒŒ์ผ ๋ณต์‚ฌ ์™„๋ฃŒ: ${envFile}'
"""
} else {
error "ํ™˜๊ฒฝ ํŒŒ์ผ์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค: ${envFile}"
}

withCredentials([[$class: 'AmazonWebServicesCredentialsBinding',
credentialsId: 'aws-credentials',
accessKeyVariable: 'AWS_ACCESS_KEY_ID',
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
sh """
aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${ECR_REGISTRY}
echo 'ECR ๋กœ๊ทธ์ธ ์™„๋ฃŒ'
"""
}
}
}
}

stage('Builder ์ด๋ฏธ์ง€ ๋นŒ๋“œ') {
steps {
script {
sh """
docker build \
-f dockerfile \
-t builder:${DOCKER_TAG} \
--platform linux/amd64 \
.
"""
}
}
}

stage('๋ชจ๋“ˆ ๋นŒ๋“œ ๋ฐ ๋ฐฐํฌ') {
matrix {
axes {
axis {
name 'MODULE'
values 'auth', 'member', 'payment', 'resume', 'notification'
}
}
stages {
stage('๋ชจ๋“ˆ ๋นŒ๋“œ ๋ฐ ํ‘ธ์‹œ') {
steps {
script {
def moduleConfig = [
auth: [path: './gitfolio-auth', index: '1'],
member: [path: './gitfolio-member', index: '1'],
payment: [path: './gitfolio-payment', index: '2'],
resume: [path: './gitfolio-resume', index: '2'],
notification: [path: './gitfolio-notification', index: '3']
]

def config = moduleConfig[MODULE]
def imageTag = "${ECR_REGISTRY}/gitfolio/${MODULE}:${DOCKER_TAG}"

sh """
docker build \
-f ${config.path}/Dockerfile \
-t ${imageTag} \
--build-arg BUILDER_IMAGE=${ECR_REGISTRY}/gitfolio/builder:${DOCKER_TAG} \
--platform linux/amd64 \
.

docker push ${imageTag}
"""

withCredentials([[$class: 'AmazonWebServicesCredentialsBinding',
credentialsId: 'aws-credentials',
accessKeyVariable: 'AWS_ACCESS_KEY_ID',
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {

def instanceIds = sh(
script: """
aws ec2 describe-instances \
--region ${AWS_REGION} \
--filters 'Name=tag:Service,Values=back' \
'Name=tag:Index,Values=${config.index}' \
'Name=tag:Environment,Values=dev' \
'Name=tag:Type,Values=ec2' \
'Name=instance-state-name,Values=running' \
--query 'Reservations[].Instances[].InstanceId' \
--output text
""",
returnStdout: true
).trim()

if (instanceIds) {
sh """
aws ssm send-command \
--instance-ids "${instanceIds}" \
--document-name "AWS-RunShellScript" \
--comment "Deploying ${MODULE} module" \
--parameters commands='
cd /home/ec2-user
docker-compose down -v --rmi all
docker builder prune -f --filter until=24h
docker image prune -f
docker-compose pull
docker-compose up -d
' \
--timeout-seconds 600 \
--region ${AWS_REGION}
"""
} else {
error "${MODULE} ๋ชจ๋“ˆ์„ ์œ„ํ•œ EC2 ์ธ์Šคํ„ด์Šค๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."
}
}
}
}
}
}
}
}
}

post {
always {
script {
sh """
docker builder prune -f --filter until=24h
docker image prune -f
rm -f .env
"""
}
}
success {
discordSend description: "dev ๋ฐฑ์—”๋“œ ๋นŒ๋“œ ๋ฐ ๋ฐฐํฌ ์„ฑ๊ณต",
footer: "Jenkins Pipeline Success",
link: env.BUILD_URL,
result: currentBuild.currentResult,
title: JOB_NAME,
webhookURL: DISCORD_CI_WEBHOOK
}
failure {
discordSend description: "dev ๋ฐฑ์—”๋“œ ๋นŒ๋“œ ๋ฐ ๋ฐฐํฌ ์‹คํŒจ",
footer: "Jenkins Pipeline Failed",
link: env.BUILD_URL,
result: currentBuild.currentResult,
title: JOB_NAME,
webhookURL: DISCORD_CI_WEBHOOK
}


}
}
145 changes: 145 additions & 0 deletions docker-compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
#services:
# builder:
# platform: linux/amd64
# build:
# context: ./
# dockerfile: dockerfile
# target: builder
# volumes:
# - gradle-cache:/root/.gradle
# - build-output:/gitfolio_back/build
# image: aida0/gitfolio_builder:test
# profiles:
# - build

# 1๋ฒˆ ๋ชจ๋“ˆ
services:
auth:
platform: linux/amd64
image: 727646500036.dkr.ecr.ap-northeast-2.amazonaws.com/gitfolio/auth:dev
container_name: gitfolio_auth
ports:
- target: 8080
published: 80
protocol: tcp
- target: 8080
published: 443
protocol: tcp
networks:
- back
member:
platform: linux/amd64
image: 727646500036.dkr.ecr.ap-northeast-2.amazonaws.com/gitfolio/member:dev
container_name: gitfolio_member
ports:
- target: 8080
published: 81
protocol: tcp
- target: 8080
published: 444
protocol: tcp
networks:
- back
networks:
back:
driver: bridge
attachable: true

#2๋ฒˆ ๋ชจ๋“ˆ
services:
resume:
platform: linux/amd64
image: 727646500036.dkr.ecr.ap-northeast-2.amazonaws.com/gitfolio/resume:dev
container_name: gitfolio_resume
ports:
- target: 8080
published: 80
protocol: tcp
- target: 8080
published: 443
protocol: tcp
networks:
- back
payment:
platform: linux/amd64
image: 727646500036.dkr.ecr.ap-northeast-2.amazonaws.com/gitfolio/payment:dev
container_name: gitfolio_payment
ports:
- target: 8080
published: 81
protocol: tcp
- target: 8080
published: 444
protocol: tcp
networks:
- back
networks:
back:
driver: overlay
attachable: true

#3๋ฒˆ๋ชจ๋“ˆ
services:
notification:
platform: linux/amd64
image: 727646500036.dkr.ecr.ap-northeast-2.amazonaws.com/gitfolio/notification:dev
container_name: gitfolio_notification
ports:
- target: 8080
published: 80
protocol: tcp
- target: 8080
published: 443
protocol: tcp
networks:
- back

zookeeper:
platform: linux/amd64
image: zookeeper:3.6
container_name: gitfolio_zookeeper
ports:
- target: 2181
published: 2181
protocol: tcp
volumes:
- zookeeper_data:/var/lib/zookeeper/data
networks:
- back

kafka:
platform: linux/amd64
image: confluentinc/cp-kafka:7.4.0
container_name: gitfolio_kafka
ports:
- target: 9092
published: 9092
protocol: tcp
- target: 29092
published: 29092
protocol: tcp
# environment: ์„น์…˜์ด ์žˆ๋‹ค๋ฉด ์ œ๊ฑฐํ•˜๊ฑฐ๋‚˜ ์ฃผ์„์ฒ˜๋ฆฌ
environment:
KAFKA_BROKER_ID: 1
KAFKA_LISTENERS: LISTENER_DOCKER://0.0.0.0:29092,LISTENER_EXTERNAL://0.0.0.0:9092
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER://localhost:29092,LISTENER_EXTERNAL://10.0.105.99:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER:PLAINTEXT,LISTENER_EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1

depends_on:
- zookeeper
volumes:
- kafka_data:/var/lib/kafka/data
networks:
- back

volumes:
zookeeper_data:
kafka_data:

networks:
back:
driver: overlay
attachable: true
Loading

0 comments on commit 6767f12

Please sign in to comment.