-
Notifications
You must be signed in to change notification settings - Fork 1
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 #131 from Quickchive/release/0.1.0
Release/0.1.0
- Loading branch information
Showing
20 changed files
with
356 additions
and
108 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Docker Image CI && Deploy to EC2 for Test Server | ||
|
||
on: | ||
push: | ||
branches: ['release/**'] | ||
|
||
jobs: | ||
job1: | ||
name: Docker Image CI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{secrets.DOCKERHUB_USERNAME}} | ||
password: ${{secrets.DOCKERHUB_TOKEN}} | ||
|
||
- name: Build and push Docker images | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
tags: hou27/test_quickchive_backend:latest | ||
push: true | ||
job2: | ||
needs: job1 | ||
name: Deploy to EC2 | ||
runs-on: quickchive-server | ||
|
||
steps: | ||
- name: executing remote ssh commands using password | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ubuntu | ||
key: ${{ secrets.KEY_PAIR }} | ||
script: | | ||
sh /home/ubuntu/actions-runner/deploy_test_server.sh |
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
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 |
---|---|---|
|
@@ -59,16 +59,17 @@ steps: | |
> ec2 ์ธ์คํด์ค ๋ด์ ์คํฌ๋ฆฝํธ ํ์ผ ์์ฑ | ||
> ์ด์ ๋ฒ์ ์ docker container์ docker image๋ฅผ ์ญ์ ํ ํ docker hub์ job1์ ํตํด ์ ๋ก๋ํ image๋ฅผ pullํ์ฌ | ||
> ํด๋น ์ด๋ฏธ์ง๋ฅผ ์ฌ์ฉํ์ฌ ๋ค์ ec2 ์ธ์คํด์ค์์ docker compose ์ปจํ ์ด๋๋ฅผ ์ค์ฑ ๋ฐ ์คํํ๋ค. | ||
> ํด๋น ์ด๋ฏธ์ง๋ฅผ ์ฌ์ฉํ์ฌ ๋ค์ ec2 ์ธ์คํด์ค์์ docker ์ปจํ ์ด๋๋ฅผ ์์ฑ ๋ฐ ์คํํ๋ค. | ||
```sh | ||
# !/bin/bash | ||
docker ps -a | grep quickchive_backend:latest | awk '{print$1}' | xargs -t -I % docker rm -f % && docker image ls | grep quickchive | awk '{print$3}' | xargs -I % docker rmi % | ||
cd ~ubuntu && docker-compose up -d | ||
docker ps -a | grep hou27/quickchive_backend | awk '{print$1}' | xargs -t -I % docker rm -f % && docker image ls | grep hou27/quickchive_backend | awk '{print$3}' | xargs -I % docker rmi % | ||
docker pull hou27/quickchive_backend | ||
cd ~ubuntu && docker run -d --name api-server -p 80:4000 --network ubuntu_shared-network -e NODE_ENV=prod --env-file .env.prod hou27/quickchive_backend | ||
``` | ||
|
||
- ๊ธฐ์กด ์ปจํ ์ด๋ ์ญ์ , ์ด๋ฏธ์ง ์ญ์ ํ | ||
docker-compose up ์คํ | ||
docker container ์คํ | ||
|
||
# ์ ์ฒด github action workflow๋ฅผ ์ ์ํ ํ์ผ | ||
|
||
|
@@ -118,3 +119,59 @@ jobs: | |
script: | | ||
sh /home/ubuntu/actions-runner/deploy.sh | ||
``` | ||
## ci-cd-for-test.yml | ||
```yaml | ||
name: Docker Image CI && Deploy to EC2 for Test Server | ||
|
||
on: | ||
push: | ||
branches: ['release/**'] | ||
|
||
jobs: | ||
job1: | ||
name: Docker Image CI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{secrets.DOCKERHUB_USERNAME}} | ||
password: ${{secrets.DOCKERHUB_TOKEN}} | ||
|
||
- name: Build and push Docker images | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
tags: hou27/test_quickchive_backend:latest | ||
push: true | ||
job2: | ||
needs: job1 | ||
name: Deploy to EC2 | ||
runs-on: quickchive-server | ||
|
||
steps: | ||
- name: executing remote ssh commands using password | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ubuntu | ||
key: ${{ secrets.KEY_PAIR }} | ||
script: | | ||
sh /home/ubuntu/actions-runner/deploy_test_server.sh | ||
``` | ||
> deploy.sh๋ ๋ฐฐํฌ ์๋ฒ์ฉ์ด์๋ค๋ฉด, | ||
> deploy_test_server.sh๋ ํ ์คํธ ์๋ฒ์ฉ. | ||
```sh | ||
# !/bin/bash | ||
docker ps -a | grep test-api-server | awk '{print$1}' | xargs -t -I % docker rm -f % && docker image ls | grep test_quickchive | awk '{print$3}' | xargs -I % docker rmi % | ||
docker pull hou27/test_quickchive_backend | ||
cd ~ubuntu && docker run -d --name test-api-server -p 3000:4000 --network ubuntu_shared-network -e NODE_ENV=test --env-file .env.test hou27/test_quickchive_backend | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# HISTORY | ||
|
||
# v0.1.0 | ||
|
||
## ๐ Added | ||
|
||
> MVP | ||
1. User | ||
|
||
- ๋ก๊ทธ์ธ: OAuth(๊ตฌ๊ธ๋ก๊ทธ์ธ, ์นด์นด์ค๋ก๊ทธ์ธ), ์ด๋ฉ์ผ ๋ก๊ทธ์ธ(์์ฒด ๋ก๊ทธ์ธ ๊ธฐ๋ฅ) | ||
- ์๋๋ก๊ทธ์ธ ์ ์ฑ : ํ๋ฌ ๋์ ์ ์ํ์ง ์์๋ ๋ก๊ทธ์ธ ์ ์ง - refresh token ํ์ฉ(๋ง๋ฃ ๊ธฐ๊ฐ ํ๋ฌ) | ||
- ํ์๊ฐ์ (์ด๋ฉ์ผ ์ธ์ฆ๋ฐฉ์) | ||
- ํ์๊ฐ์ ์ ๋ฐ๋ ์ ๋ณด: ์ด๋ฉ์ผ(๋ฉ์ผ๋ก ์ธ์ฆํ์), ๋๋ค์, ๋น๋ฐ๋ฒํธ(8์ ์ด์ ๋ฌธ์, ์ซ์) | ||
- ๋๋ค์ ์์ | ||
- ๋น๋ฐ๋ฒํธ ์ฌ์ค์ | ||
- ๋ก๊ทธ์์ | ||
- ํ์ ํํด | ||
|
||
2. Content | ||
|
||
- ์ ์ฅ: ์ฝํ ์ธ ์ด๋ฆ, \*URL, ๋ฉ๋ชจ, ์นดํ ๊ณ ๋ฆฌ, ์ฆ๊ฒจ์ฐพ๊ธฐ, ์ฝ์ ๊ธฐํ | ||
- ์ญ์ | ||
- ์์ : ์ฝํ ์ธ ์ด๋ฆ, ๋ฉ๋ชจ, ์นดํ ๊ณ ๋ฆฌ, ์ฆ๊ฒจ์ฐพ๊ธฐ, ์ฝ์ ๊ธฐํ | ||
|
||
3. Collection | ||
|
||
- ์ ์ฅ: \*์ฝ๋ ์ ์ด๋ฆ, ์ฝ๋ ์ ์ค๋ช , URL, ์นดํ ๊ณ ๋ฆฌ, ์ฆ๊ฒจ์ฐพ๊ธฐ | ||
- ์ญ์ | ||
- ์์ : ์ฝํ ์ธ ์ด๋ฆ, URL(์ถ๊ฐ, ์ญ์ , ์์ ๋ณ๊ฒฝ), ์นดํ ๊ณ ๋ฆฌ, ์ฝ์ ๊ธฐํ | ||
|
||
4. ์๋ฆผ | ||
|
||
- ์ฝ์ ๊ธฐํ ์๋ฆผ: ๋งค์ผ 08:00 KST์ ์ฝ์ ๊ธฐํ ๋ง๋ฃ๋ ์ฝํ ์ธ ์ ๋ํ ๋ฉ์ผ ์๋ฆผ ์ ์ก | ||
|
||
## ๐ Changed | ||
|
||
None | ||
|
||
## :no_entry_sign: Removed | ||
|
||
None |
Oops, something went wrong.