Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📌 Learning Summary
(이번 세션에서 배운 내용과 어떤 기능을 구현했는지 최대한 구체적으로 작성해주세요.)
🔑 Key
수동 zip 파일 올리기 안 하고 git clone 해서 더 편하게 했다! (장점: 변경사항 있으면 git pull 명령어로 바로 반영 가능)
📒 Reference
rm -r <폴더명>🔎 Result
https://HyerinStudyBack13thLikelion.pythonanywhere.com/forum/question/my
✍🏻 Review
세션에서 배운 배포 실습을 바탕으로, 더 효율적이고 자동화할 수 있는 방법을 여러 방면으로 고민했다. 아직 멋사 세션에서 CI/CD를 배우지 않았지만, 작년에 github actions를 조금 사용해본 경험이 있어, pythonanywhere 자동 배포 github actions 템플릿을 사용하여 CI/CD를 구축해 보려고 했다. 이 템플릿은 pythonanywhere api token을 받아 console을 항상 열어 놓고, 타겟 브랜치에 push 이벤트가 발생하면 git pull → 파이썬 가상환경 실행 → 라이브러리 재설치 → migrate 명령어를 자동으로 실행한다. 그런데 가상환경을 실행하는 명령어가
source /bin/activate로 설정되어 있어서 난관에 봉착했다. 가상환경을 만들 때는 반드시 이름을 지정해야 하고, 그러면 루트에<가상환경 이름>폴더가 생성되며 그 하위에 가상환경 관련 파일이 존재하게 된다. 즉, 가상환경을 실행할 때는source <가상환경 이름>/bin/activate명령어를 실행해야 한다. 이 시점에서 제대로 된 CI/CD를 구축하는 것을 포기하고, 다른 방법을 생각했다. 변경사항이 있을 때마다 매번 프로젝트 파일을 압축하고 업로드하고 압축 해제하고 기존 파일을 삭제하는 번거로운 방식보다 조금 더 발전한, git clone한 뒤 변경사항이 있을 때마다 git pull 명령어 한 번으로 받아오는 조금 더 편한 방식 말이다. 브랜치 push 이벤트에 따른 자동 CI/CD가 아닌 건 아쉽지만, 세션에서 배운 파일 업로드 방식보다 조금 더 발전한 방식을 찾은 것을 칭찬하고 싶다!