Skip to content

Commit

Permalink
feat: 유저 프로필 조회 API에 카카오 아이디 추가 (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
injoon2019 authored Sep 15, 2024
1 parent a19dbc0 commit ba39ab3
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 88 deletions.
176 changes: 88 additions & 88 deletions .github/workflows/elk-deploy-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
name: Bottles ELK Deploy Workflow

on:
push:
branches:
- develop

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'

- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
shell: bash

- name: Build with gradle
run: ./gradlew clean build
shell: bash

- name: Get Github Actions IP
id: ip
uses: haythem/[email protected]

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Add Github Actions IP to Security group
run: |
aws ec2 authorize-security-group-ingress --group-id ${{ secrets.AWS_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32
- name: Transfer file using SCP
env:
SERVER_HOST: ${{ secrets.ELK_SERVER_HOST }}
SERVER_USER_NAME: ${{ secrets.ELK_SERVER_USER_NAME }}
SERVER_PRIVATE_KEY: ${{ secrets.ELK_SERVER_PRIVATE_KEY }}
run: |
printf "%s" "$SERVER_PRIVATE_KEY" > private_key.pem
chmod 600 private_key.pem
scp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i private_key.pem ./elk/docker-compose.yml $SERVER_USER_NAME@$SERVER_HOST:/home/$SERVER_USER_NAME/docker
scp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i private_key.pem ./elk/kibana/kibana.yml $SERVER_USER_NAME@$SERVER_HOST:/home/$SERVER_USER_NAME/elk/kibana
scp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i private_key.pem ./elk/logstash/pipeline/logstash.conf $SERVER_USER_NAME@$SERVER_HOST:/home/$SERVER_USER_NAME/elk/logstash
scp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i private_key.pem ./elk/logstash/logstash.yml $SERVER_USER_NAME@$SERVER_HOST:/home/$SERVER_USER_NAME/elk/logstash
rm private_key.pem
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.ELK_SERVER_HOST }}
username: ${{ secrets.ELK_SERVER_USER_NAME }}
key: ${{ secrets.ELK_SERVER_PRIVATE_KEY }}
script: |
if [ -f /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh ]; then
rm /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh
fi
echo "export ELASTIC_USERNAME=${{ secrets.ELASTIC_USERNAME }}" > /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh
echo "export ELASTIC_PASSWORD=${{ secrets.ELASTIC_PASSWORD }}" >> /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh
echo "export LOGSTASH_PORT=${{ secrets.LOGSTASH_PORT }}" >> /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh
echo "export KIBANA_PORT=${{ secrets.KIBANA_PORT }}" >> /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh
sed 's/^export //' /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh > /home/${{ secrets.ELK_SERVER_USER_NAME }}/docker/.env
- name: Remove Github Actions IP From Security Group
run: |
aws ec2 revoke-security-group-ingress --group-id ${{ secrets.AWS_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32
#name: Bottles ELK Deploy Workflow
#
#on:
# push:
# branches:
# - develop
#
#jobs:
# deploy:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
#
# - name: Setup JDK 17
# uses: actions/setup-java@v3
# with:
# distribution: 'corretto'
# java-version: '17'
#
# - name: Cache Gradle
# uses: actions/cache@v3
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
#
# - name: Grant execute permission for gradlew
# run: chmod +x gradlew
# shell: bash
#
# - name: Build with gradle
# run: ./gradlew clean build
# shell: bash
#
# - name: Get Github Actions IP
# id: ip
# uses: haythem/[email protected]
#
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ap-northeast-2
#
# - name: Add Github Actions IP to Security group
# run: |
# aws ec2 authorize-security-group-ingress --group-id ${{ secrets.AWS_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32
#
# - name: Transfer file using SCP
# env:
# SERVER_HOST: ${{ secrets.ELK_SERVER_HOST }}
# SERVER_USER_NAME: ${{ secrets.ELK_SERVER_USER_NAME }}
# SERVER_PRIVATE_KEY: ${{ secrets.ELK_SERVER_PRIVATE_KEY }}
# run: |
# printf "%s" "$SERVER_PRIVATE_KEY" > private_key.pem
# chmod 600 private_key.pem
# scp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i private_key.pem ./elk/docker-compose.yml $SERVER_USER_NAME@$SERVER_HOST:/home/$SERVER_USER_NAME/docker
# scp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i private_key.pem ./elk/kibana/kibana.yml $SERVER_USER_NAME@$SERVER_HOST:/home/$SERVER_USER_NAME/elk/kibana
# scp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i private_key.pem ./elk/logstash/pipeline/logstash.conf $SERVER_USER_NAME@$SERVER_HOST:/home/$SERVER_USER_NAME/elk/logstash
# scp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i private_key.pem ./elk/logstash/logstash.yml $SERVER_USER_NAME@$SERVER_HOST:/home/$SERVER_USER_NAME/elk/logstash
# rm private_key.pem
#
# - name: Deploy to server
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.ELK_SERVER_HOST }}
# username: ${{ secrets.ELK_SERVER_USER_NAME }}
# key: ${{ secrets.ELK_SERVER_PRIVATE_KEY }}
# script: |
# if [ -f /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh ]; then
# rm /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh
# fi
#
# echo "export ELASTIC_USERNAME=${{ secrets.ELASTIC_USERNAME }}" > /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh
# echo "export ELASTIC_PASSWORD=${{ secrets.ELASTIC_PASSWORD }}" >> /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh
# echo "export LOGSTASH_PORT=${{ secrets.LOGSTASH_PORT }}" >> /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh
# echo "export KIBANA_PORT=${{ secrets.KIBANA_PORT }}" >> /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh
#
# sed 's/^export //' /home/${{ secrets.ELK_SERVER_USER_NAME }}/deploy/env_vars.sh > /home/${{ secrets.ELK_SERVER_USER_NAME }}/docker/.env
#
# - name: Remove Github Actions IP From Security Group
# run: |
# aws ec2 revoke-security-group-ingress --group-id ${{ secrets.AWS_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class UserProfileFacade(
return UserProfileResponse(
userName = user.name,
age = user.getKoreanAge(),
kakaoId = user.kakaoId,
imageUrl = userProfile?.imageUrl,
introduction = userProfile?.introduction ?: emptyList(),
profileSelect = userProfile?.profileSelect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.nexters.bottles.app.user.domain.UserProfileSelect
data class UserProfileResponse(
val userName: String?,
val age: Int,
val kakaoId: String?,
val imageUrl: String? = null,
val introduction: List<QuestionAndAnswer>,
val profileSelect: UserProfileSelect? = null,
Expand Down

0 comments on commit ba39ab3

Please sign in to comment.