-
Notifications
You must be signed in to change notification settings - Fork 0
Bug/#38 #41
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
Bug/#38 #41
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,66 @@ | ||||||||||||||||||||||||||||||||||
| name: Spring Deplot to EC2 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||
| types: [closed] | ||||||||||||||||||||||||||||||||||
| branches: ["develop"] | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Set up JDK 17 | ||||||||||||||||||||||||||||||||||
| uses: actions/setup-java@v4 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| java-version: '17' | ||||||||||||||||||||||||||||||||||
| distribution: 'temurin' | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: application.properties 파일 설정 | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| mkdir -p src/main/resources | ||||||||||||||||||||||||||||||||||
| mkdir -p src/test/resources | ||||||||||||||||||||||||||||||||||
| echo "${{ secrets.APPLICATION_PROPERTIES }}" > ./src/main/resources/application.properties | ||||||||||||||||||||||||||||||||||
| echo "${{ secrets.TEST_APPLICATION_PROPERTIES }}" > ./src/test/resources/application.properties | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
Comment on lines
+24
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
- echo "${{ secrets.APPLICATION_PROPERTIES }}" > ./src/main/resources/application.properties
- echo "${{ secrets.TEST_APPLICATION_PROPERTIES }}" > ./src/test/resources/application.properties
+ cat <<'EOF' > ./src/main/resources/application.properties
+${{ secrets.APPLICATION_PROPERTIES }}
+EOF
+ cat <<'EOF' > ./src/test/resources/application.properties
+${{ secrets.TEST_APPLICATION_PROPERTIES }}
+EOF📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| - name: Setup Gradle | ||||||||||||||||||||||||||||||||||
| uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Build with Gradle Wrapper | ||||||||||||||||||||||||||||||||||
| run: ./gradlew clean build | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: 빌드된 파일 이름 변경하기 | ||||||||||||||||||||||||||||||||||
| run: mv ./build/libs/*SNAPSHOT.jar ./cd.jar | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: SCP로 EC2에 빌드된 파일 전송하기 | ||||||||||||||||||||||||||||||||||
| uses: appleboy/scp-action@v0.1.7 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| host: ${{ secrets.EC2_HOST }} | ||||||||||||||||||||||||||||||||||
| username: ${{ secrets.EC2_USER }} | ||||||||||||||||||||||||||||||||||
| key: ${{ secrets.EC2_SSH_KEY }} | ||||||||||||||||||||||||||||||||||
| source: cd.jar | ||||||||||||||||||||||||||||||||||
| target: /home/ubuntu/clue | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| deploy: | ||||||||||||||||||||||||||||||||||
| needs: build | ||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: SSH로 EC2에 접속하기 | ||||||||||||||||||||||||||||||||||
| uses: appleboy/ssh-action@v0.1.7 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| host: ${{ secrets.EC2_HOST }} | ||||||||||||||||||||||||||||||||||
| username: ${{ secrets.EC2_USER }} | ||||||||||||||||||||||||||||||||||
| key: ${{ secrets.EC2_SSH_KEY }} | ||||||||||||||||||||||||||||||||||
| script_stop: true | ||||||||||||||||||||||||||||||||||
| script: | | ||||||||||||||||||||||||||||||||||
| cd clue | ||||||||||||||||||||||||||||||||||
| sudo fuser -k -n tcp 8080 || true | ||||||||||||||||||||||||||||||||||
| sudo nohup java -jar cd.jar > ./output.log 2>&1 & | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+56
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 백그라운드 실행/포트 종료 로직이 취약합니다
- sudo nohup java -jar cd.jar > ./output.log 2>&1 &
+ sudo nohup java -jar /home/ubuntu/clue/cd.jar > /home/ubuntu/clue/output.log 2>&1 &🧰 Tools🪛 YAMLlint (1.37.1)[error] 66-66: no new line character at the end of file (new-line-at-end-of-file) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
This file was deleted.
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.
🛠️ Refactor suggestion
PR
closed이벤트만으로는 머지 여부를 보장하지 못합니다닫힌(PR closed) 후에도 ‘머지되지 않은 닫힘’이 포함됩니다. 머지된 경우에만 배포하려면 각 job 또는 step에 조건을 추가하세요.
🤖 Prompt for AI Agents