-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#127] 배포 자동화 구현 #128
[#127] 배포 자동화 구현 #128
Conversation
|
.github/workflows/dev-CD.yml
Outdated
runs-on: ubuntu-22.04 | ||
env: | ||
working-directory-spring: main | ||
working-directory-nextjs: server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NestJs로 수정해주세요~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
가독성 이유로 말씀주신게 맞을까요?! 넵 알겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음 가독성이라기 보다는 nextjs는 프론트에서 사용하는걸로 알고 있어서요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 next라고 했군요! 감사합나다!
deploy.sh
Outdated
(cd $DIR && sed -i "s/^SPRING_PORT=.*/SPRING_PORT=${SPRING_GREEN_PORT}/" .env) | ||
(cd $DIR && sed -i "s/^NESTJS_PORT=.*/NESTJS_PORT=${NESTJS_GREEN_PORT}/" .env) | ||
(cd $DIR && sed -i "s/^SPRING_NAME=.*/SPRING_NAME=${SPRING_GREEN_NAME}/" .env) | ||
(cd $DIR && sed -i "s/^NESTJS_NAME=.*/NESTJS_NAME=${NESTJS_GREEN_NAME}/" .env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
불필요한 코드는 삭제해도 좋을 것 같아요 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 알겠습니다!!
|
||
on: | ||
push: | ||
branches: [ "develop" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
main 브랜치도 추가하면 좋을 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev 환경에서 몇번 배포하면서 안정화가 되면 main 브랜치를 추가하려고 했는데 어떻게 생각하시나요?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 것 같아요 :)
|
||
on: | ||
pull_request: | ||
branches: [ "develop" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
main 브랜치도 추가하면 좋을 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻👍🏻
👩💻 Contents
배포 자동화를 구현했습니다.
deploy.sh
와docker-compose.yml
,docker-compose.dev,yml
파일은 ec2 내에 저장할 예정입니다! 리뷰를 위해서 해당 파일들을 추가해서 커밋하였고, 리뷰 후에는 삭제할 예정입니다!첫번째 사진은 현재 동작하는 green을 down하고, blue를 up하는 과정입니다.
첫번째 사진과 두번째 사진의
tmp.sh
파일의 실행 로그만 살짝 다른 이유는 두 가지 방식 다 가능함을 테스트하려고 일부러 살짝 다르게 작성했습니다. 리뷰 후에는 코드를 수정할 예정입니다!두번째 사진은 첫번째 사진 이후에 바로 이어지는 동작입니다! 첫번째 사진에서 up된 blue를 down하고, 다시 green를 up하는 과정입니다!
📝 Review Note
npm run start:dev
명령어를 사용하면 nextjs 서버가 정상적으로 돌아가는 것을 확인했습니다. 결국 도커파일의 문제 같지만 제가 node쪽을 잘 몰라서 빠르게 해결하진 못할 상황 같습니다..!인바운드 규칙 편집
정도가 있을 것 같습니다. 제가 세팅중에 어떤 과정을 빠트리거나, 그게 아니라면 Caddy쪽의 문제로 보입니다! 정말 죄송하지만 혹시 가능하시다면 개인 ec2에서 연결 테스트를 해봐주실 수 있을까요..?!!? 만약 같은 오류가 발생한다면 Caddy쪽 문제일거 같아서 말씀드렸습니다!📣 Related Issue