-
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 remote-tracking branch 'origin/develop' into feature/iOS/GWL-16
- Loading branch information
Showing
22 changed files
with
732 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,63 @@ | ||
name: BackEnd-CI | ||
|
||
on: | ||
push: | ||
branches: 'feature/BE/*' | ||
pull_request: | ||
branches: 'develop' | ||
types: [labeled, opened, synchronize, reopened] | ||
|
||
jobs: | ||
test: | ||
if: contains(github.event.pull_request.labels.*.name, '💻백엔드') | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 코드 체크아웃 | ||
uses: actions/checkout@v2 | ||
|
||
- name: node 세팅 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '18' | ||
|
||
- name: 의존성 설치 | ||
run: npm ci | ||
working-directory: ./BackEnd | ||
|
||
- name: 테스트 진행 | ||
run: npm test | ||
working-directory: ./BackEnd | ||
|
||
deploy: | ||
needs: test | ||
if: github.ref == 'refs/heads/develop' && github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: docker/setup-buildx-action@v2 | ||
- uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ secrets.NCP_CONTAINER_REGISTRY }} | ||
username: ${{ secrets.NCP_ACCESS_KEY }} | ||
password: ${{ secrets.NCP_SECRET_KEY }} | ||
- uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./BackEnd/Dockerfile | ||
push: true | ||
tags: ${{ secrets.NCP_CONTAINER_REGISTRY }}/my-app:latest | ||
- name: SSH Tunneling and Deploy | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.BASTION_HOST }} | ||
username: ${{ secrets.BASTION_USER }} | ||
key: ${{ secrets.BASTION_SSH_KEY }} | ||
script: | | ||
ssh -o StrictHostKeyChecking=no -L 9999:${{ secrets.INTERNAL_SERVER_IP }}:22 ${{ secrets.BASTION_USER }}@localhost -i ${{ secrets.BASTION_SSH_PRIVATE_KEY_PATH }} -fN | ||
ssh -o StrictHostKeyChecking=no -p 9999 ${{ secrets.SERVER_USER }}@localhost -i ${{ secrets.SERVER_SSH_PRIVATE_KEY_PATH }} ' | ||
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 3000:3000 --env-file /var/env/.env ${{ secrets.NCP_CONTAINER_REGISTRY }}/my-app:latest | ||
' |
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,36 @@ | ||
name: iOS-CI | ||
|
||
on: | ||
push: | ||
branches: 'feature/iOS/*' | ||
pull_request: | ||
branches: 'develop' | ||
types: [labeled, opened, synchronize, reopened] | ||
|
||
jobs: | ||
tuist-test: | ||
if: contains(github.event.pull_request.labels.*.name, '📱 iOS') | ||
runs-on: macos-13 | ||
env: | ||
working-directory: ./iOS | ||
|
||
steps: | ||
- name: Xcode Version Settings | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: "15.0.1" | ||
|
||
- name: Code Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Tuist | ||
run: brew install tuist | ||
working-directory: ${{env.working-directory}} | ||
|
||
- name: Print Tuist Version | ||
run: tuist version | ||
working-directory: ${{env.working-directory}} | ||
|
||
- name: Run Tuist Test | ||
run: make test | ||
working-directory: ${{env.working-directory}} |
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"] |
77 changes: 77 additions & 0 deletions
77
...s/Features/Record/Sources/RecordScene/CollectionViewCell/CalendarCollectionViewCell.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,77 @@ | ||
// | ||
// CalendarCollectionViewCell.swift | ||
// RecordFeature | ||
// | ||
// Created by 안종표 on 2023/11/18. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import DesignSystem | ||
import UIKit | ||
|
||
// MARK: - CalendarCollectionViewCell | ||
|
||
final class CalendarCollectionViewCell: UICollectionViewCell { | ||
private let stackView: UIStackView = { | ||
let stackView = UIStackView() | ||
stackView.translatesAutoresizingMaskIntoConstraints = false | ||
stackView.spacing = 1 | ||
stackView.alignment = .center | ||
stackView.distribution = .fillEqually | ||
stackView.axis = .vertical | ||
return stackView | ||
}() | ||
|
||
let dayOfWeekLabel: UILabel = { | ||
let label = UILabel() | ||
label.font = .preferredFont(forTextStyle: .footnote) | ||
label.text = "월" | ||
label.textColor = DesignSystemColor.gray03 | ||
return label | ||
}() | ||
|
||
let dateLabel: UILabel = { | ||
let label = UILabel() | ||
label.font = .preferredFont(forTextStyle: .body, with: .traitBold) | ||
label.text = "16" | ||
label.textColor = DesignSystemColor.gray03 | ||
return label | ||
}() | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder _: NSCoder) { | ||
fatalError("No Xib") | ||
} | ||
|
||
func configure(calendarInformation: CalendarInforamtion) { | ||
configureUI() | ||
dayOfWeekLabel.text = calendarInformation.dayOfWeek | ||
dateLabel.text = calendarInformation.date | ||
} | ||
} | ||
|
||
private extension CalendarCollectionViewCell { | ||
func configureUI() { | ||
[dayOfWeekLabel, dateLabel].forEach { | ||
stackView.addArrangedSubview($0) | ||
} | ||
contentView.addSubview(stackView) | ||
NSLayoutConstraint.activate([ | ||
stackView.topAnchor.constraint(equalTo: contentView.topAnchor), | ||
stackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), | ||
stackView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), | ||
stackView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor), | ||
]) | ||
} | ||
} | ||
|
||
// MARK: - CalendarInforamtion | ||
|
||
struct CalendarInforamtion { | ||
let dayOfWeek: String | ||
let date: String | ||
} |
92 changes: 92 additions & 0 deletions
92
.../Record/Sources/RecordScene/CollectionViewCell/WorkoutInformationCollectionViewCell.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,92 @@ | ||
// | ||
// WorkoutInformationCollectionViewCell.swift | ||
// RecordFeature | ||
// | ||
// Created by 안종표 on 2023/11/16. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import DesignSystem | ||
import UIKit | ||
|
||
// MARK: - WorkoutInformationCollectionViewCell | ||
|
||
final class WorkoutInformationCollectionViewCell: UICollectionViewCell { | ||
private let stackView: UIStackView = { | ||
let stackView = UIStackView() | ||
stackView.translatesAutoresizingMaskIntoConstraints = false | ||
stackView.spacing = 6 | ||
stackView.alignment = .center | ||
stackView.distribution = .fillEqually | ||
stackView.axis = .vertical | ||
return stackView | ||
}() | ||
|
||
private let sportLabel: UILabel = { | ||
let label = UILabel() | ||
label.font = .preferredFont(forTextStyle: .body) | ||
label.text = "운동: 사이클" | ||
return label | ||
}() | ||
|
||
private let timeLabel: UILabel = { | ||
let label = UILabel() | ||
label.font = .preferredFont(forTextStyle: .body) | ||
label.text = "시간: 07:00~08:00" | ||
return label | ||
}() | ||
|
||
private let distanceLabel: UILabel = { | ||
let label = UILabel() | ||
label.font = .preferredFont(forTextStyle: .body) | ||
label.text = "거리: 12.43km" | ||
return label | ||
}() | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder _: NSCoder) { | ||
fatalError("No Xib") | ||
} | ||
|
||
func configure(workoutInformation: WorkoutInformation) { | ||
configureUI() | ||
sportLabel.text = "\(workoutInformation.sport)" | ||
timeLabel.text = "\(workoutInformation.time)" | ||
distanceLabel.text = "\(workoutInformation.distance)" | ||
} | ||
} | ||
|
||
private extension WorkoutInformationCollectionViewCell { | ||
func configureUI() { | ||
contentView.backgroundColor = DesignSystemColor.gray01 | ||
|
||
[sportLabel, timeLabel, distanceLabel].forEach { | ||
stackView.addArrangedSubview($0) | ||
} | ||
contentView.addSubview(stackView) | ||
NSLayoutConstraint.activate([ | ||
stackView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor), | ||
stackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: Metrics.leadingTrailingpadding), | ||
stackView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -Metrics.leadingTrailingpadding), | ||
]) | ||
} | ||
} | ||
|
||
// MARK: - Metrics | ||
|
||
private enum Metrics { | ||
static let leadingTrailingpadding: CGFloat = 10 | ||
static let topBottomPadding: CGFloat = 47 | ||
} | ||
|
||
// MARK: - WorkoutInformation | ||
|
||
struct WorkoutInformation { | ||
let sport: String | ||
let time: String | ||
let distance: String | ||
} |
54 changes: 54 additions & 0 deletions
54
iOS/Projects/Features/Record/Sources/RecordScene/View/NoRecordsView.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,54 @@ | ||
// | ||
// NoRecordsView.swift | ||
// RecordFeature | ||
// | ||
// Created by 안종표 on 2023/11/17. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import DesignSystem | ||
import UIKit | ||
|
||
// MARK: - NoRecordsView | ||
|
||
final class NoRecordsView: UIView { | ||
private let noRecordLabel: UILabel = { | ||
let label = UILabel() | ||
label.translatesAutoresizingMaskIntoConstraints = false | ||
label.text = "아직 기록이 없습니다\n기록하러 가볼까요?" | ||
label.numberOfLines = 0 | ||
label.font = .preferredFont(forTextStyle: .title3) | ||
return label | ||
}() | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
configureUI() | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder _: NSCoder) { | ||
fatalError("No Xib") | ||
} | ||
} | ||
|
||
private extension NoRecordsView { | ||
func configureUI() { | ||
backgroundColor = DesignSystemColor.gray01 | ||
|
||
addSubview(noRecordLabel) | ||
NSLayoutConstraint.activate([ | ||
noRecordLabel.topAnchor.constraint(equalTo: topAnchor, constant: Metrics.topBottomPadding), | ||
noRecordLabel.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Metrics.leadingTrailing), | ||
noRecordLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Metrics.leadingTrailing), | ||
noRecordLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -Metrics.topBottomPadding), | ||
]) | ||
} | ||
} | ||
|
||
// MARK: - Metrics | ||
|
||
private enum Metrics { | ||
static let topBottomPadding: CGFloat = 35 | ||
static let leadingTrailing: CGFloat = 60 | ||
} |
Oops, something went wrong.