Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#1 #2

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# github repository actions 페이지에 나타날 이름
name: CI/CD using github actions & docker

# event trigger
# main이나 feature/#1 브랜치에 push가 되었을 때 실행
on:
push:
branches: ["main", "feature/#1"]

permissions:
contents: read

jobs:
CI-CD:
runs-on: ubuntu-latest
steps:
# JDK setting - github actions에서 사용할 JDK 설정 (프로젝트나 AWS의 java 버전과 달라도 무방)
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"

- name: checkout
uses: actions/checkout@master

- name: create env file
run: |
touch .env
echo "${{ secrets.ENV_VARS }}" >> .env

# - name: executing remote ssh commands using password
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.HOST }}
# username: ubuntu
# key: ${{ secrets.PRIVATE_KEY }}
# script: |
# sh ../../deploy.sh

# # gradle caching - 빌드 시간 향상
# - name: Gradle Caching
# uses: actions/cache@v3
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-

# # # 환경별 yml 파일 생성(1) - application.yml
# # - name: make application.yml
# # if: |
# # contains(github.ref, 'main') ||
# # contains(github.ref, 'develop')
# # run: |
# # mkdir ./Backend/src/main/resources # resources 폴더 생성
# # cd ./Backend/src/main/resources # resources 폴더로 이동
# # touch ./application.yml # application.yml 생성
# # echo "${{ secrets.YML }}" > ./application.yml # github actions에서 설정한 값을 application.yml 파일에 쓰기
# # shell: bash

# # 환경별 yml 파일 생성(1) - api
# - name: make application-api.yml
# contains(github.ref, 'main') ||
# contains(github.ref, 'feature/#1')
# run: |
# cd ../../Backend/src/main/resources/security
# touch ./application-api.yml
# echo "${{ secrets.YML_API }}" > ./application-api.yml
# shell: bash

# # 환경별 yml 파일 생성(2) - database
# - name: make application-database.yml

# contains(github.ref, 'main') ||
# contains(github.ref, 'feature/#1')
# run: |
# cd ../../Backend/src/main/resources/security
# touch ./application-database.yml
# echo "${{ secrets.YML_DATABASE }}" > ./application-database.yml
# shell: bash

# # 환경별 yml 파일 생성(3) - security
# - name: make application-security.yml
# contains(github.ref, 'main') ||
# contains(github.ref, 'feature/#1')
# run: |
# cd ../../Backend/src/main/resources/security
# touch ./application-security.yml
# echo "${{ secrets.YML_SECURITY }}" > ./application-security.yml
# shell: bash

# # gradle build
# - name: Build with Gradle
# run: ./gradlew build -x test

# # docker build & push to production
# - name: Docker build & push to prod
# if: contains(github.ref, 'main')
# run: |
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# docker build -f Dockerfile-dev -t ${{ secrets.DOCKER_USERNAME }}/docker-test-prod .
# docker push ${{ secrets.DOCKER_USERNAME }}/docker-test-prod

# # docker build & push to develop
# - name: Docker build & push to dev
# if: contains(github.ref, 'feature/#1')
# run: |
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# docker build -f Dockerfile-dev -t ${{ secrets.DOCKER_USERNAME }}/docker-test-dev .
# docker push ${{ secrets.DOCKER_USERNAME }}/docker-test-dev

# ## deploy to production
# - name: Deploy to prod
# uses: appleboy/ssh-action@master
# id: deploy-prod
# if: contains(github.ref, 'main')
# with:
# host: ${{ secrets.HOST }} # EC2 퍼블릭 IPv4 DNS
# username: ubuntu
# key: ${{ secrets.PRIVATE_KEY }}
# # envs: GITHUB_SHA
# script: |
# sudo docker ps
# sudo docker pull ${{ secrets.DOCKER_USERNAME }}/docker-test-prod
# docker-compose up -d
# sudo docker image prune -f

# # deploy to develop
# - name: Deploy to dev
# uses: appleboy/ssh-action@master
# id: deploy-dev
# if: contains(github.ref, 'feature/#1')
# with:
# host: ${{ secrets.HOST }} # EC2 퍼블릭 IPv4 DNS
# username: ubuntu
# key: ${{ secrets.PRIVATE_KEY }}
# script: |
# sudo docker ps
# sudo docker pull ${{ secrets.DOCKER_USERNAME }}/docker-test-dev
# docker-compose up -d
# sudo docker image prune -f
2 changes: 1 addition & 1 deletion Android
Submodule Android updated 43 files
+1 −1 app/build.gradle.kts
+8 −0 app/src/main/java/com/ssafy/tott/data/datasource/AccountDataSource.kt
+3 −3 app/src/main/java/com/ssafy/tott/data/datasource/BuildingDataSource.kt
+7 −0 app/src/main/java/com/ssafy/tott/data/datasource/mapper/UserMapper.kt
+16 −0 app/src/main/java/com/ssafy/tott/data/datasource/remote/AccountDataSourceRemote.kt
+31 −12 app/src/main/java/com/ssafy/tott/data/datasource/remote/BuildingRemoteDataSource.kt
+9 −0 app/src/main/java/com/ssafy/tott/data/model/RegisterAccountRequest.kt
+27 −0 app/src/main/java/com/ssafy/tott/data/model/request/SearchFilterRequest.kt
+22 −0 app/src/main/java/com/ssafy/tott/data/model/response/BuildingDetailResponse.kt
+8 −0 app/src/main/java/com/ssafy/tott/data/model/response/BuildingListResponse.kt
+31 −0 app/src/main/java/com/ssafy/tott/data/model/response/BuildingResponse.kt
+6 −2 app/src/main/java/com/ssafy/tott/data/repository/BuildingRepositoryImpl.kt
+14 −0 app/src/main/java/com/ssafy/tott/data/repository/UserRepositoryImpl.kt
+28 −0 app/src/main/java/com/ssafy/tott/di/ApiService.kt
+16 −2 app/src/main/java/com/ssafy/tott/di/DataModule.kt
+50 −0 app/src/main/java/com/ssafy/tott/di/NetworkModule.kt
+6 −0 app/src/main/java/com/ssafy/tott/domain/exception/Exceptions.kt
+1 −0 app/src/main/java/com/ssafy/tott/domain/model/Building.kt
+1 −1 app/src/main/java/com/ssafy/tott/domain/model/BuildingDetail.kt
+16 −0 app/src/main/java/com/ssafy/tott/domain/model/RegisterUser.kt
+1 −1 app/src/main/java/com/ssafy/tott/domain/repository/SearchBuildingRepository.kt
+7 −0 app/src/main/java/com/ssafy/tott/domain/repository/UserRepository.kt
+11 −0 app/src/main/java/com/ssafy/tott/domain/usecase/RegisterUserUseCase.kt
+1 −1 app/src/main/java/com/ssafy/tott/domain/usecase/SearchBuildingUseCase.kt
+30 −7 app/src/main/java/com/ssafy/tott/ui/buildingdetail/BuildingDetailActivity.kt
+25 −2 app/src/main/java/com/ssafy/tott/ui/houselist/BuildingDetailListAdapter.kt
+0 −25 app/src/main/java/com/ssafy/tott/ui/houselist/BuildingDetailViewHolder.kt
+22 −5 app/src/main/java/com/ssafy/tott/ui/map/SearchMapActivity.kt
+41 −22 app/src/main/java/com/ssafy/tott/ui/map/SearchMapViewModel.kt
+16 −9 app/src/main/java/com/ssafy/tott/ui/map/SimpleHouseListDialogFragment.kt
+17 −1 app/src/main/java/com/ssafy/tott/ui/model/BuildingDetailUI.kt
+51 −0 app/src/main/java/com/ssafy/tott/ui/register/RegisterActivity.kt
+40 −0 app/src/main/java/com/ssafy/tott/ui/register/RegisterViewModel.kt
+14 −5 app/src/main/java/com/ssafy/tott/ui/searchfilter/SearchFilterFragment.kt
+10 −0 app/src/main/java/com/ssafy/tott/ui/util/ImageLoader.kt
+11 −0 app/src/main/java/com/ssafy/tott/ui/util/SerializeGetter.kt
+16 −0 app/src/main/java/com/ssafy/tott/ui/util/SerializeMapper.kt
+1 −1 app/src/main/res/layout/activity_login.xml
+8 −8 app/src/main/res/layout/activity_register.xml
+28 −8 app/src/main/res/layout/fragment_search_filter.xml
+5 −2 app/src/main/res/values/strings.xml
+1 −0 app/src/main/res/values/style.xml
+4 −0 app/src/main/res/values/values.xml
2 changes: 1 addition & 1 deletion Backend
Submodule Backend updated 98 files
+0 −11 .github/workflows/google-java-format.yml
+2 −1 build.gradle
+0 −1 src/main/java/com/ssafy/tott/TottApplication.java
+0 −1 src/main/java/com/ssafy/tott/account/domain/BankCode.java
+11 −9 src/main/java/com/ssafy/tott/account/service/AccountService.java
+2 −4 src/main/java/com/ssafy/tott/api/infra/SchedulerConfig.java
+1 −0 src/main/java/com/ssafy/tott/api/kakao/property/KakaoProperties.java
+17 −10 src/main/java/com/ssafy/tott/api/kakao/service/KakaoMapFetchAPI.java
+1 −1 src/main/java/com/ssafy/tott/api/kakao/util/KakaoApiConfiguration.java
+3 −2 src/main/java/com/ssafy/tott/api/seoulopendata/data/vo/RentData.java
+3 −5 src/main/java/com/ssafy/tott/api/seoulopendata/data/vo/RentRow.java
+13 −6 src/main/java/com/ssafy/tott/api/seoulopendata/service/SeoulOpenDataRentHouseFetchAPI.java
+5 −4 src/main/java/com/ssafy/tott/api/seoulopendata/service/SeoulOpenDataService.java
+13 −16 src/main/java/com/ssafy/tott/api/shinhan/ShinhanBankAPI.java
+0 −1 src/main/java/com/ssafy/tott/api/shinhan/dto/ShinhanBankDataBody.java
+1 −0 src/main/java/com/ssafy/tott/api/shinhan/dto/request/ShinhanBankAPIRequest.java
+1 −0 src/main/java/com/ssafy/tott/api/shinhan/dto/response/ShinhanBankAPIResponse.java
+2 −1 src/main/java/com/ssafy/tott/api/shinhan/service/searchaccounts/dto/ShinhanBankSearchAccountsFetchAPI.java
+2 −1 src/main/java/com/ssafy/tott/api/shinhan/service/searchname/ShinhanBankSearchNameFetchAPI.java
+1 −0 ...in/java/com/ssafy/tott/api/shinhan/service/searchname/dto/request/ShinhanBankSearchNameRequestDataBody.java
+2 −2 src/main/java/com/ssafy/tott/api/shinhan/service/transfer1/ShinhanBankTransfer1FetchAPI.java
+4 −2 ...main/java/com/ssafy/tott/api/shinhan/service/transfer1/dto/request/ShinhanBankTransfer1RequestDataBody.java
+0 −1 ...va/com/ssafy/tott/api/shinhan/service/transfer1/dto/response/body/Transfer1ResponseShinhanBankDataBody.java
+6 −4 src/main/java/com/ssafy/tott/auth/annotation/AuthenticatedArgumentResolver.java
+2 −1 src/main/java/com/ssafy/tott/auth/dto/response/TokenResponse.java
+3 −5 src/main/java/com/ssafy/tott/auth/service/AuthService.java
+7 −5 src/main/java/com/ssafy/tott/auth/service/CustomUserDetailService.java
+12 −6 src/main/java/com/ssafy/tott/auth/support/JwtAccessDeniedHandler.java
+11 −3 src/main/java/com/ssafy/tott/auth/support/JwtAuthenticationEntryPoint.java
+3 −2 src/main/java/com/ssafy/tott/auth/support/JwtFilter.java
+31 −32 src/main/java/com/ssafy/tott/auth/support/TokenProvider.java
+3 −2 src/main/java/com/ssafy/tott/budget/controller/BudgetController.java
+1 −4 src/main/java/com/ssafy/tott/budget/data/vo/BudgetVO.java
+12 −11 src/main/java/com/ssafy/tott/budget/service/BudgetService.java
+1 −5 src/main/java/com/ssafy/tott/global/config/OpenApiConfig.java
+1 −0 src/main/java/com/ssafy/tott/global/domain/BaseEntity.java
+6 −7 src/main/java/com/ssafy/tott/global/security/SecurityConfig.java
+14 −0 src/main/java/com/ssafy/tott/housedetail/controller/HouseDetailController.java
+3 −3 src/main/java/com/ssafy/tott/housedetail/domain/HouseDetail.java
+24 −0 src/main/java/com/ssafy/tott/housegeo/controller/HouseGeoController.java
+51 −0 src/main/java/com/ssafy/tott/housegeo/data/cond/HouseGeoFilterCond.java
+23 −0 src/main/java/com/ssafy/tott/housegeo/data/dto/request/GeoSearchRequest.java
+25 −0 src/main/java/com/ssafy/tott/housegeo/data/dto/response/HouseGeoSearchResponse.java
+25 −0 src/main/java/com/ssafy/tott/housegeo/data/vo/HouseSearchDetailVO.java
+39 −0 src/main/java/com/ssafy/tott/housegeo/data/vo/HouseSearchGeoVO.java
+11 −5 src/main/java/com/ssafy/tott/housegeo/domain/HouseGeo.java
+2 −1 src/main/java/com/ssafy/tott/housegeo/domain/HouseGeoRepository.java
+10 −0 src/main/java/com/ssafy/tott/housegeo/domain/query/HouseGeoRepositoryCustom.java
+34 −0 src/main/java/com/ssafy/tott/housegeo/domain/query/HouseGeoRepositoryImpl.java
+31 −6 src/main/java/com/ssafy/tott/housegeo/service/HouseGeoService.java
+6 −5 src/main/java/com/ssafy/tott/member/controller/MemberController.java
+21 −0 src/main/java/com/ssafy/tott/member/data/cond/MemberExistBySignupCond.java
+3 −2 src/main/java/com/ssafy/tott/member/data/dto/request/MemberSignupRequest.java
+1 −1 src/main/java/com/ssafy/tott/member/data/dto/request/MemberVerificationRequest.java
+1 −1 src/main/java/com/ssafy/tott/member/data/dto/responsse/MemberSignupResponse.java
+1 −1 src/main/java/com/ssafy/tott/member/data/dto/responsse/MemberVerificationResponse.java
+7 −1 src/main/java/com/ssafy/tott/member/domain/Member.java
+2 −1 src/main/java/com/ssafy/tott/member/domain/MemberRepository.java
+9 −2 src/main/java/com/ssafy/tott/member/domain/MemberVerificationCache.java
+2 −1 src/main/java/com/ssafy/tott/member/domain/Role.java
+2 −1 src/main/java/com/ssafy/tott/member/domain/embbeded/Password.java
+7 −0 src/main/java/com/ssafy/tott/member/domain/query/MemberRepositoryCustom.java
+27 −0 src/main/java/com/ssafy/tott/member/domain/query/MemberRepositoryImpl.java
+2 −1 src/main/java/com/ssafy/tott/member/exception/MemberErrorCode.java
+1 −1 src/main/java/com/ssafy/tott/member/mapper/MemberMapper.java
+13 −8 src/main/java/com/ssafy/tott/member/service/MemberService.java
+19 −7 src/main/java/com/ssafy/tott/member/service/MemberVerificationService.java
+13 −0 src/main/java/com/ssafy/tott/region/controller/RegionController.java
+33 −0 src/main/java/com/ssafy/tott/region/data/cond/RegionFilterCond.java
+2 −4 src/main/java/com/ssafy/tott/region/domain/Region.java
+2 −1 src/main/java/com/ssafy/tott/region/domain/RegionRepository.java
+10 −0 src/main/java/com/ssafy/tott/region/domain/query/RegionRepositoryCustom.java
+27 −0 src/main/java/com/ssafy/tott/region/domain/query/RegionRepositoryImpl.java
+22 −0 src/main/java/com/ssafy/tott/region/exception/RegionErrorCode.java
+10 −0 src/main/java/com/ssafy/tott/region/exception/RegionException.java
+2 −1 src/main/java/com/ssafy/tott/region/mapper/RegionMapper.java
+13 −1 src/main/java/com/ssafy/tott/region/service/RegionService.java
+5 −3 src/main/resources/application.yml
+28 −2 src/test/java/com/ssafy/tott/api/kakao/module/KakaoAPITest.java
+5 −5 src/test/java/com/ssafy/tott/api/seoul/HouseAPITest.java
+9 −6 src/test/java/com/ssafy/tott/api/shinhan/ShinhanBankAPITest.java
+3 −1 src/test/java/com/ssafy/tott/auth/service/AuthServiceTest.java
+6 −4 src/test/java/com/ssafy/tott/budget/domain/BudgetRepositoryTest.java
+11 −10 src/test/java/com/ssafy/tott/budget/service/BudgetServiceTest.java
+2 −11 src/test/java/com/ssafy/tott/global/fixture/BudgetFixture.java
+13 −9 src/test/java/com/ssafy/tott/global/fixture/MemberFixture.java
+51 −21 src/test/java/com/ssafy/tott/housedetail/repository/HouseDetailRepositoryTest.java
+51 −20 src/test/java/com/ssafy/tott/housedetail/service/HouseDetailServiceTest.java
+48 −19 src/test/java/com/ssafy/tott/housegeo/repository/HouseGeoRepositoryTest.java
+73 −35 src/test/java/com/ssafy/tott/housegeo/service/HouseGeoServiceTest.java
+1 −1 src/test/java/com/ssafy/tott/member/domain/MemberRepositoryTest.java
+11 −7 src/test/java/com/ssafy/tott/member/domain/embbeded/EmailTest.java
+10 −3 src/test/java/com/ssafy/tott/member/domain/embbeded/PasswordTest.java
+2 −3 src/test/java/com/ssafy/tott/member/domain/embbeded/PhoneNumberTest.java
+9 −7 src/test/java/com/ssafy/tott/member/service/MemberServiceTest.java
+3 −3 src/test/java/com/ssafy/tott/member/service/MemberVerificationServiceTest.java
+36 −8 src/test/java/com/ssafy/tott/region/repository/RegionRepositoryTest.java
+52 −22 src/test/java/com/ssafy/tott/region/service/RegionServiceTest.java
33 changes: 33 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Installing docker engine if not exists
if ! type docker > /dev/null
then
echo "docker does not exist"
echo "Start installing docker"
sudo apt-get update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install -y docker-ce
fi

# Installing docker-compose if not exists
if ! type docker-compose > /dev/null
then
echo "docker-compose does not exist"
echo "Start installing docker-compose"
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
fi

echo "start submoudle update"
cd /home/ubuntu/srv/ubuntu
mkdir alertmanager
sudo git submodule init
sudo git submodule update --recursive --remote --merge
# sudo mv /home/ubuntu/srv/ubuntu/.env /home/ubuntu/srv/ubuntu/backend/
# echo "start docker-compose up: ubuntu"
# sudo docker-compose -f /home/ubuntu/srv/ubuntu/docker-compose.yml up --build -d