-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #426 from tukcomCD2024/develop_back
feat : 백엔드 코어 서버 개발 master 합병
- Loading branch information
Showing
311 changed files
with
10,982 additions
and
2,084 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,49 @@ | ||
name: ci/cd | ||
name: notification-ci/cd | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop_back_notification | ||
- 'hotfix/[0-9a-zA-z]+-B-notification-#[0-9a-zA-z]+' | ||
pull_request: | ||
branches: | ||
- develop_back_notification | ||
|
||
jobs: | ||
build_and_test: | ||
name: build and test | ||
if: ${{github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: ./backend/core | ||
|
||
steps: | ||
- name: set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'liberica' | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
token: ${{ secrets.CI_PAT }} | ||
|
||
- name: formatting | ||
uses: axel-op/googlejavaformat-action@v3 | ||
with: | ||
args: "--replace" | ||
skip-commit: true | ||
|
||
- name: grant execute permission for gradlew | ||
run: chmod +x ./gradlew | ||
|
||
- name: test | ||
run: ./gradlew clean test | ||
|
||
deploy-notification: | ||
name: notification application deploy | ||
if: ${{ github.event_name == 'push' }} | ||
|
@@ -80,28 +117,29 @@ jobs: | |
|
||
- name: Add Github Actions IP to Security group | ||
run: | | ||
aws ec2 authorize-security-group-ingress --group-id ${{ secrets.AWS_EC2_NOTIFICATION_SG_ID }} --group-name ${{secrets.AWS_EC2_NOTIFICATION_SG_NAME}} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32 | ||
aws ec2 authorize-security-group-ingress --group-id ${{ secrets.AWS_EC2_CORE_SG_ID }} --group-name ${{secrets.AWS_EC2_CORE_SG_NAME}} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32 | ||
- name: Connect ec2 and Run Docker Container | ||
uses: appleboy/[email protected] | ||
env: | ||
AWS_ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
with: | ||
host: ${{ secrets.SSH_NOTIFICATION_HOST }} | ||
host: ${{ secrets.SSH_CORE_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_CORE_PRIVATE_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
docker ps -q --filter "name=notification" | xargs -r docker stop | ||
docker ps -aq --filter "name=notification" | xargs -r docker rm | ||
aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username ${{ secrets.AWS_DOCKER_USER }} --password-stdin ${{ secrets.AWS_USER_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com | ||
docker image prune -f | ||
docker pull ${{ steps.meta.outputs.tags }} | ||
docker run -d -p 8080:8080 --name notification --network test_backend ${{ steps.meta.outputs.tags }} | ||
docker run -d -p 8081:8081 -e ENVIRONMENT=dev --name notification --network test_backend ${{ steps.meta.outputs.tags }} | ||
- name: Remove Github Actions IP from security group | ||
if: always() | ||
run: | | ||
aws ec2 revoke-security-group-ingress --group-id ${{ secrets.AWS_EC2_NOTIFICATION_SG_ID }} --group-name ${{secrets.AWS_EC2_NOTIFICATION_SG_NAME}} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32 | ||
aws ec2 revoke-security-group-ingress --group-id ${{ secrets.AWS_EC2_CORE_SG_ID }} --group-name ${{secrets.AWS_EC2_CORE_SG_NAME}} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32 | ||
- uses: sarisia/actions-status-discord@v1 | ||
if: success() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import celery_app | ||
__all__ = ('celery_app',) |
143 changes: 69 additions & 74 deletions
143
backend/AnimatedDrawings/application/animation_queue.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.