Skip to content
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

Feat/deploy springboot CD #63

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft

Conversation

thisisWooyeol
Copy link
Contributor

수정사항

  • develop 브랜치에 push 시 springboot 코드를 ec2 서버에 자동 배포하는 github action을 구현했습니다.
  • 기존 linux screen을 이용하는 것이 아닌 nohup (no hung up)을 사용했습니다.
  • 참고한 사이트는 다음과 같습니다. Github Action을 활용한 SpringBoot 프로젝트 CI/CD

참고사항

  • 현재는 테스트를 위해 develop 브랜치에 PR이 올라가도 동작하도록 설정했습니다. 확인 이후 push 조건에 대해서만 작동하도록 수정하겠습니다.
  • main과 develop 코드에 대해 api를 분리해 사용할 수 있으면 좋겠으나 그러면 android, springboot 설정도 매번 건드려야 해 복잡해지므로 생략했습니다.

fix: ec2 target directory
fix: fix host key verification failed <- add remote server to known hosts
refactor: rename springboot action names
fix: add ssh script to run springboot app & add comments
@thisisWooyeol thisisWooyeol force-pushed the feat/deploy-springboot-cd branch from 1409077 to 21f7549 Compare November 20, 2023 12:49
@thisisWooyeol
Copy link
Contributor Author

FIXME: action 실행은 되나 서버에 배포가 안 됨.

@thisisWooyeol thisisWooyeol force-pushed the feat/deploy-springboot-cd branch 2 times, most recently from ead9625 to 8d8f03b Compare November 20, 2023 14:33
@thisisWooyeol thisisWooyeol force-pushed the feat/deploy-springboot-cd branch from a7984c5 to 3226e78 Compare November 20, 2023 15:53
@thisisWooyeol
Copy link
Contributor Author

서버 배포는 잘 작동하나 커넥션이 끊기지 않고 기다리다가 ssh connection "client_loop: send disconnect: Broken pipe" 에러가 뜨면서 끝남. -> HOLD

@thisisWooyeol thisisWooyeol marked this pull request as draft November 22, 2023 00:38
@thisisWooyeol thisisWooyeol force-pushed the feat/deploy-springboot-cd branch 4 times, most recently from b3cfa71 to 035efd1 Compare November 28, 2023 13:07
@thisisWooyeol
Copy link
Contributor Author

기존 api 서버 작업이 kill 되기는 하지만 새 백그라운드 nohub 코드가 실행되지는 않음.

sudo nohup /usr/bin/java -jar ${{ secrets.SPRINGBOOT_TARGET_DIR }}/*.jar & \
> ${{ secrets.SPRINGBOOT_ROOT_DIR }}/app.log 2>&1 &"

fix: add test account key command for github action
@thisisWooyeol thisisWooyeol force-pushed the feat/deploy-springboot-cd branch from e752c8f to 561da24 Compare November 28, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants