-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/BE/GWL-64
- Loading branch information
Showing
28 changed files
with
833 additions
and
112 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,45 @@ | ||
name: BackEnd-CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
paths: | ||
- 'BackEnd/**' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ secrets.NCP_CONTAINER_REGISTRY }} | ||
username: ${{ secrets.NCP_ACCESS_KEY }} | ||
password: ${{ secrets.NCP_SECRET_KEY }} | ||
|
||
- uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./BackEnd/Dockerfile | ||
push: true | ||
tags: ${{ secrets.NCP_CONTAINER_REGISTRY }}/my-app:latest | ||
|
||
- name: SSH to Internal Server and Deploy | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.BASTION_HOST }} | ||
username: ${{ secrets.BASTION_USER }} | ||
password: ${{ secrets.BASTION_PASSWORD }} | ||
port: 22 | ||
script: | | ||
sshpass -p ${{ secrets.SERVER_PASSWORD }} ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USER }}@${{ secrets.INTERNAL_SERVER_IP }} -p 22 ' | ||
docker pull ${{ secrets.NCP_CONTAINER_REGISTRY }}/my-app:latest | ||
docker stop my-app || true | ||
docker rm my-app || true | ||
docker run --name my-app -d -p 443:3000 -p 80:3000 ${{ secrets.NCP_CONTAINER_REGISTRY }}/my-app:latest | ||
docker cp /var/env/.env my-app:/app/.env | ||
' |
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,17 @@ | ||
# 빌드 단계 | ||
FROM node:18 AS builder | ||
WORKDIR /app | ||
COPY BackEnd/package*.json ./ | ||
RUN npm install | ||
COPY BackEnd/ . | ||
RUN npm run build | ||
|
||
# 실행 단계 | ||
FROM node:18 | ||
WORKDIR /app | ||
COPY --from=builder /app/dist ./dist | ||
COPY --from=builder /app/package*.json ./ | ||
RUN npm install --only=production | ||
RUN npm install pm2 -g | ||
EXPOSE 3000 | ||
CMD ["pm2-runtime", "start", "dist/main.js"] |
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 |
---|---|---|
|
@@ -13,4 +13,6 @@ import Foundation | |
public enum CoordinatorFlow { | ||
case login | ||
case tabBar | ||
case workoutSetting | ||
case workout | ||
} |
13 changes: 13 additions & 0 deletions
13
.../Record/Sources/Common/Coordinator/Delegate/WorkoutSettingCoordinatorFinishDelegate.swift
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,13 @@ | ||
// | ||
// WorkoutSettingCoordinatorFinishDelegate.swift | ||
// RecordFeature | ||
// | ||
// Created by 안종표 on 2023/11/20. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol WorkoutSettingCoordinatorFinishDelegate: AnyObject { | ||
func workoutSettingCoordinatorDidFinished(workoutSetting: WorkoutSetting) | ||
} |
15 changes: 15 additions & 0 deletions
15
...jects/Features/Record/Sources/Common/Coordinator/Protocol/RecordFeatureCoordinating.swift
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,15 @@ | ||
// | ||
// RecordFeatureCoordinating.swift | ||
// RecordFeature | ||
// | ||
// Created by 안종표 on 2023/11/20. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import Coordinator | ||
import Foundation | ||
|
||
protocol RecordFeatureCoordinating: Coordinating { | ||
func showSettingFlow() | ||
func showWorkoutFlow(workoutSetting: WorkoutSetting) | ||
} |
16 changes: 16 additions & 0 deletions
16
iOS/Projects/Features/Record/Sources/Common/Coordinator/Protocol/WorkoutCoordinating.swift
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,16 @@ | ||
// | ||
// WorkoutCoordinating.swift | ||
// RecordFeature | ||
// | ||
// Created by 안종표 on 2023/11/20. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import Coordinator | ||
import Foundation | ||
|
||
protocol WorkoutCoordinating: Coordinating { | ||
func pushWorkoutSummaryViewController() | ||
func pushWorkoutMapViewController() | ||
func pushWorkoutResultViewController() | ||
} |
18 changes: 18 additions & 0 deletions
18
...ects/Features/Record/Sources/Common/Coordinator/Protocol/WorkoutSettingCoordinating.swift
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,18 @@ | ||
// | ||
// WorkoutSettingCoordinating.swift | ||
// RecordFeature | ||
// | ||
// Created by 안종표 on 2023/11/20. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import Coordinator | ||
import Foundation | ||
|
||
protocol WorkoutSettingCoordinating: Coordinating { | ||
func pushWorkoutSelectViewController() | ||
func pushWorkoutEnvironmentSetupViewController(workoutSetting: WorkoutSetting) | ||
func pushOpponentSearchViewController(workoutSetting: WorkoutSetting) | ||
func pushCountdownViewController(workoutSetting: WorkoutSetting) | ||
func finish(workoutSetting: WorkoutSetting) | ||
} |
65 changes: 65 additions & 0 deletions
65
iOS/Projects/Features/Record/Sources/Common/Coordinator/RecordFeatureCoordinator.swift
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,65 @@ | ||
// | ||
// RecordFeatureCoordinator.swift | ||
// RecordFeature | ||
// | ||
// Created by 안종표 on 2023/11/20. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import Coordinator | ||
import UIKit | ||
|
||
// MARK: - RecordFeatureCoordinator | ||
|
||
public final class RecordFeatureCoordinator: RecordFeatureCoordinating { | ||
public var navigationController: UINavigationController | ||
public var childCoordinators: [Coordinating] = [] | ||
public weak var finishDelegate: CoordinatorFinishDelegate? | ||
public var flow: CoordinatorFlow = .workoutSetting | ||
public var recordContainerViewController: RecordContainerViewController | ||
|
||
public init( | ||
navigationController: UINavigationController | ||
) { | ||
self.navigationController = navigationController | ||
recordContainerViewController = RecordContainerViewController() | ||
} | ||
|
||
public func start() { | ||
navigationController.pushViewController(recordContainerViewController, animated: false) | ||
} | ||
|
||
func showSettingFlow() { | ||
let workoutSettingCoordinator = WorkoutSettingCoordinator(navigationController: navigationController) | ||
childCoordinators.append(workoutSettingCoordinator) | ||
workoutSettingCoordinator.finishDelegate = self | ||
workoutSettingCoordinator.settingDidFinishedDelegate = self | ||
workoutSettingCoordinator.start() | ||
} | ||
|
||
func showWorkoutFlow(workoutSetting _: WorkoutSetting) { | ||
let workoutCoordinator = WorkoutCoordinator(navigationController: navigationController) | ||
childCoordinators.append(workoutCoordinator) | ||
workoutCoordinator.finishDelegate = self | ||
workoutCoordinator.start() | ||
} | ||
} | ||
|
||
// MARK: CoordinatorFinishDelegate | ||
|
||
extension RecordFeatureCoordinator: CoordinatorFinishDelegate { | ||
public func flowDidFinished(childCoordinator: Coordinating) { | ||
childCoordinators = childCoordinators.filter { | ||
$0.flow != childCoordinator.flow | ||
} | ||
navigationController.popToRootViewController(animated: false) | ||
} | ||
} | ||
|
||
// MARK: WorkoutSettingCoordinatorFinishDelegate | ||
|
||
extension RecordFeatureCoordinator: WorkoutSettingCoordinatorFinishDelegate { | ||
func workoutSettingCoordinatorDidFinished(workoutSetting: WorkoutSetting) { | ||
showWorkoutFlow(workoutSetting: workoutSetting) | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
iOS/Projects/Features/Record/Sources/Common/Coordinator/WorkoutCoordinator.swift
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,40 @@ | ||
// | ||
// WorkoutCoordinator.swift | ||
// RecordFeature | ||
// | ||
// Created by 안종표 on 2023/11/20. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import Coordinator | ||
import UIKit | ||
|
||
final class WorkoutCoordinator: WorkoutCoordinating { | ||
var navigationController: UINavigationController | ||
var childCoordinators: [Coordinating] = [] | ||
weak var finishDelegate: CoordinatorFinishDelegate? | ||
var flow: CoordinatorFlow = .workout | ||
|
||
init(navigationController: UINavigationController) { | ||
self.navigationController = navigationController | ||
} | ||
|
||
func start() { | ||
pushWorkoutSummaryViewController() | ||
} | ||
|
||
func pushWorkoutSummaryViewController() { | ||
let workoutSummaryViewController = WorkoutSummaryViewController( | ||
viewModel: WorkoutSummaryViewModel() | ||
) | ||
navigationController.pushViewController(workoutSummaryViewController, animated: false) | ||
} | ||
|
||
func pushWorkoutMapViewController() { | ||
// TODO: 뷰 컨트롤러 시작 로직 작성 | ||
} | ||
|
||
func pushWorkoutResultViewController() { | ||
// TODO: 뷰 컨트롤러 시작 로직 작성 | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
iOS/Projects/Features/Record/Sources/Common/Coordinator/WorkoutSettingCoordinator.swift
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,49 @@ | ||
// | ||
// WorkoutSettingCoordinator.swift | ||
// RecordFeature | ||
// | ||
// Created by 안종표 on 2023/11/20. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import Coordinator | ||
import UIKit | ||
|
||
final class WorkoutSettingCoordinator: WorkoutSettingCoordinating { | ||
var navigationController: UINavigationController | ||
var childCoordinators: [Coordinating] = [] | ||
weak var finishDelegate: CoordinatorFinishDelegate? | ||
var flow: CoordinatorFlow = .workoutSetting | ||
weak var settingDidFinishedDelegate: WorkoutSettingCoordinatorFinishDelegate? | ||
|
||
init(navigationController: UINavigationController) { | ||
self.navigationController = navigationController | ||
} | ||
|
||
func start() { | ||
pushWorkoutSelectViewController() | ||
} | ||
|
||
func pushWorkoutSelectViewController() { | ||
let workoutSelectViewController = WorkoutSelectViewController() | ||
navigationController.pushViewController(workoutSelectViewController, animated: false) | ||
} | ||
|
||
func pushWorkoutEnvironmentSetupViewController(workoutSetting _: WorkoutSetting) { | ||
// TODO: WorkoutEnvironmentSetupViewController의 Usecase에 workoutSetting 객체를 전달해줘야한다. | ||
let workoutEnvironmentViewController = WorkoutEnvironmentSetupViewController() | ||
navigationController.pushViewController(workoutEnvironmentViewController, animated: false) | ||
} | ||
|
||
func pushOpponentSearchViewController(workoutSetting _: WorkoutSetting) { | ||
// TODO: 뷰 컨트롤러 시작 로직 작성 | ||
} | ||
|
||
func pushCountdownViewController(workoutSetting _: WorkoutSetting) { | ||
// TODO: 뷰 컨트롤러 시작 로직 작성 | ||
} | ||
|
||
func finish(workoutSetting: WorkoutSetting) { | ||
settingDidFinishedDelegate?.workoutSettingCoordinatorDidFinished(workoutSetting: workoutSetting) | ||
} | ||
} |
Oops, something went wrong.