Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Heize-jiyean committed Aug 16, 2024
2 parents 1375e17 + 982bbbe commit d9a9344
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 36 deletions.
81 changes: 52 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,55 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true

- name: Configure Docker
run: gcloud auth configure-docker --quiet

- name: Build Docker image
run: docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_INSTANCE_NAME }}-image:${{ github.sha }} .

- name: Push Docker image to GCR
run: docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_INSTANCE_NAME }}-image:${{ github.sha }}

- name: Deploy to GCE
run: |
gcloud compute instances update-container ${{ secrets.GCP_INSTANCE_NAME }} \
--zone ${{ secrets.GCP_INSTANCE_ZONE }} \
--container-image gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_INSTANCE_NAME }}-image:${{ github.sha }}
- name: Verify deployment
run: |
gcloud compute ssh --zone ${{ secrets.GCP_INSTANCE_ZONE }} ${{ secrets.GCP_INSTANCE_NAME }} -- \
'docker ps'
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true

- name: Configure Docker
run: |
gcloud auth configure-docker gcr.io --quiet
- name: Build Docker image
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USER: ${{ secrets.DB_USER }}
DB_PW: ${{ secrets.DB_PW }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_NAME: ${{ secrets.DB_NAME }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
NAVER_MAP_CLIENT_ID: ${{ secrets.NAVER_MAP_CLIENT_ID }}
VDB_HOST: ${{ secrets.VDB_HOST }}
VDB_PORT: ${{ secrets.VDB_PORT }}
run: |
docker build \
--build-arg DB_HOST=${DB_HOST} \
--build-arg DB_USER=${DB_USER} \
--build-arg DB_PW=${DB_PW} \
--build-arg DB_PORT=${DB_PORT} \
--build-arg DB_NAME=${DB_NAME} \
--build-arg SECRET_KEY=${SECRET_KEY} \
--build-arg NAVER_MAP_CLIENT_ID=${NAVER_MAP_CLIENT_ID} \
--build-arg VDB_HOST=${VDB_HOST} \
--build-arg VDB_PORT=${VDB_PORT} \
-t gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_INSTANCE_NAME }}-image:${{ github.sha }} .
- name: Push Docker image to GCR
run: |
docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_INSTANCE_NAME }}-image:${{ github.sha }}
- name: Deploy to GCE
run: |
gcloud compute instances update-container ${{ secrets.GCP_INSTANCE_NAME }} \
--zone ${{ secrets.GCP_INSTANCE_ZONE }} \
--container-image gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_INSTANCE_NAME }}-image:${{ github.sha }}
- name: Verify deployment
run: |
gcloud compute ssh --zone ${{ secrets.GCP_INSTANCE_ZONE }} ${{ secrets.GCP_INSTANCE_NAME }} -- \
'docker ps'
4 changes: 2 additions & 2 deletions controllers/profileController.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ exports.listAllDiaries = async (req, res) => {
// 관심 환자인지 여부 확인
let isCounselorScrapPatient;
if (role === 'counselor') {
isCounselorScrapPatient = await ScrapModel.checkCounselorScrapPatient(patientId, loginId);
isCounselorScrapPatient = await ScrapModel.checkCounselorScrapPatient(patientUser.patient_id, loginId);
}

// 렌더링 부분에서 변수 전달
Expand Down Expand Up @@ -256,7 +256,7 @@ exports.listAllGuestbooks = async (req, res) => {
// `isCounselorScrapPatient` 변수 추가
let isCounselorScrapPatient;
if (loginRole === 'counselor') {
isCounselorScrapPatient = await ScrapModel.checkCounselorScrapPatient(patientId, loginId);
isCounselorScrapPatient = await ScrapModel.checkCounselorScrapPatient(patientUser.patient_id, loginId);
}

//임의로 손댄부분(원본주석,아래코드임의작성)
Expand Down
12 changes: 7 additions & 5 deletions python/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,13 @@ def delete_vectors():
idx = data['idx']
ids = data['ids']

qdrant.delete(
collection_name=collection_name[idx],
points_selector=ids,
wait=True
)
if len(ids) > 0:

qdrant.delete(
collection_name=collection_name[idx],
points_selector=ids,
wait=True
)

return jsonify({'message': 'Success'}), 200
else:
Expand Down

0 comments on commit d9a9344

Please sign in to comment.