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 1225ac2
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 37 deletions.
79 changes: 49 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,56 @@ on:
push:
branches: [main]

env:
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCE_INSTANCE: ${{ secrets.GCP_INSTANCE_NAME }}
GCE_INSTANCE_ZONE: ${{ secrets.GCP_INSTANCE_ZONE }}

jobs:
build-and-deploy:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
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
uses: actions/checkout@v2

- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'

- name: 'Use gcloud CLI'
run: 'gcloud info'

- name: Configure Docker
run: |
gcloud auth configure-docker --quiet
- name: Build
run: |-
docker build \
--tag "gcr.io/$PROJECT_ID/$GCE_INSTANCE-image:${{ github.sha }}" \
--build-arg DB_HOST=${{ secrets.DB_HOST }} \
--build-arg DB_USER=${{ secrets.DB_USER }} \
--build-arg DB_PW=${{ secrets.DB_PW }} \
--build-arg DB_PORT=${{ secrets.DB_PORT }} \
--build-arg DB_NAME=${{ secrets.DB_NAME }} \
--build-arg SECRET_KEY=${{ secrets.SECRET_KEY }} \
--build-arg NAVER_MAP_CLIENT_ID=${{ secrets.NAVER_MAP_CLIENT_ID }} \
--build-arg VDB_HOST=${{ secrets.VDB_HOST }} \
--build-arg VDB_PORT=${{ secrets.VDB_PORT }} \
.
- name: Publish
run: |-
docker push "gcr.io/$PROJECT_ID/$GCE_INSTANCE-image:${{ github.sha }}"
- name: Deploy
run: |-
gcloud compute instances update-container "$GCE_INSTANCE" \
--zone "$GCE_INSTANCE_ZONE" \
--container-image "gcr.io/$PROJECT_ID/$GCE_INSTANCE-image:${{ github.sha }}"
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 1225ac2

Please sign in to comment.