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

build: Android CI&CD 수정 #626

Merged
merged 73 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
d69ddbb
fix: 누락된 not 연산자 추가
hxeyexn Oct 15, 2024
62c65f2
refactor: whitelist 추가 #489 (#490)
linirini Oct 16, 2024
5c47e5f
deploy: 1.1.1 배포 #484 (#491)
linirini Oct 16, 2024
5352574
feat: 인덱스 설정 스크립트 작성 #474 (#475)
linirini Oct 18, 2024
11795f6
feat: Bulk Delete 예전 pr 코드 이동 (#487)
linirini Oct 18, 2024
a689391
refactor: N+1 문제 해결 (#488)
Ho-Tea Oct 18, 2024
aba9632
fix: 스타카토 댓글 UI 오류 해결 및 개선 #493 (#494)
Junyoung-WON Oct 21, 2024
0449e56
refactor: 반응형 ui 적용 및 접근성 향상 #481 (#502)
hxeyexn Oct 22, 2024
e0d9229
deploy: 1.1.2 배포 (#504)
BurningFalls Oct 22, 2024
9f1113f
hotfix: 이미지 삭제 전파 (#505)
Ho-Tea Oct 22, 2024
a13636b
deploy: 1.1.3 배포 (#506)
Ho-Tea Oct 22, 2024
aa41c91
feat: 기본 추억 제공 구현 #508 (#509)
linirini Oct 22, 2024
ca9a49d
deploy: 1.2.0 배포 (#510)
linirini Oct 22, 2024
ea794d0
fix: file changed 인식 불가로 인한 순서 변경 (#511)
linirini Oct 23, 2024
8751c66
Merge remote-tracking branch 'origin/release-be' into develop
linirini Oct 23, 2024
c6d7d81
fix: 충돌 해결
linirini Oct 23, 2024
2cdd6fc
deploy: 1.2.0 배포 (#512)
linirini Oct 23, 2024
3fb6578
feat: 모든 화면에서 네트워크 에러 핸들링 #501 (#516)
s6m1n Oct 23, 2024
e0d93a0
build: 안드로이드 CI/CD 재설정 #445 (#513)
Junyoung-WON Oct 24, 2024
401c13e
fix: 안드로이드 CI 오류 수정 #519 (#521)
Junyoung-WON Oct 24, 2024
dc5bfb7
feat: 나의 추억들 정렬 기능 구현 #503 (#507)
hxeyexn Oct 24, 2024
51e37e7
ui: 기분 캐릭터 변경 #522 (#523)
hxeyexn Oct 24, 2024
e911a10
feat: 카메라 촬영 기능 연결 #514 (#524)
Junyoung-WON Oct 24, 2024
f6dc532
deploy: v.1.2.0 배포 준비 #515 (#525)
Junyoung-WON Oct 24, 2024
6becb72
fix: Android CD 수정 #527 (#528)
Junyoung-WON Oct 24, 2024
bc6efe4
chore: Thread, Hikari CP 변경 (#518)
linirini Oct 24, 2024
335a6fa
Merge branch 'release-an' into develop
s6m1n Oct 24, 2024
9e9d38f
feat: 기본 추억 제목 변경 #530 (#531)
BurningFalls Oct 24, 2024
2590ab9
deploy: 1.2.1 배포 (#532)
linirini Oct 24, 2024
a19098f
fix: 스타카토 삭제 시 마커가 갱신되지 않는 오류 해결 #533 (#534)
hxeyexn Oct 24, 2024
d0915c4
feat & fix: 사진 코루틴 취소 버그 수정 / ACTION_PICK_IMAGES 적용 #536 (#537)
s6m1n Oct 31, 2024
997d3cd
docs: bug-issue-template 생성
s6m1n Nov 6, 2024
6f9e91f
docs: 기능 이슈 템플릿 작성
linirini Nov 8, 2024
c6cc0c6
docs: 기능 이슈 템플릿 수정
linirini Nov 8, 2024
1c373da
docs: 기능 이슈 템플릿 수정
linirini Nov 8, 2024
7158c3b
docs: 리팩터링 이슈 템플릿 작성
linirini Nov 8, 2024
fc4a32b
docs: 기존 이슈 템플릿 제거
linirini Nov 8, 2024
df2e70f
chore: cd workflow 작동 브랜치 수정
linirini Nov 8, 2024
8de620e
refactor: comments api uri 수정 #544 (#549)
linirini Nov 13, 2024
bf1039d
refactor: 스타카토 목록 조회 시 최신순 정렬 #545 (#550)
linirini Nov 13, 2024
d5c83b2
fix: 추억 생성 및 수정 썸네일 사진 업로드 오류 수정 #535 (#542)
hxeyexn Nov 20, 2024
7730421
chore: 개발 서버 이전 #551 (#557)
linirini Nov 25, 2024
bc0a7ad
refactor: comment API의 URI 수정 #560 (#561)
Junyoung-WON Nov 27, 2024
f2434a5
deploy: v.1.2.1 배포 준비 #539 (#541)
Junyoung-WON Nov 27, 2024
6e52524
fix: merge conflict 해결
Junyoung-WON Nov 27, 2024
87cd6a4
chore: 운영환경 마이그레이션 #551 (#563)
Ho-Tea Dec 1, 2024
5b2c344
refactor: 카테고리, 일시 선택 순서 변경 및 리팩터링 (스타카토 생성/수정) #564 (#567)
s6m1n Jan 11, 2025
977c856
fix: 사진 첨부를 길게 터치할 시 액티비티가 종료되는 버그 (스타카토 생성/수정 화면) #588 (#589)
s6m1n Jan 11, 2025
c6f9efe
refactor: Comment API의 버저닝(v2) 제거 #584 (#592)
Junyoung-WON Jan 11, 2025
bbfed7e
chore: 다중 운영환경 CD 테스트 (#568)
Ho-Tea Jan 12, 2025
b0bceed
ui: 도메인명 변경에 따라 추억을 카테고리로 수정 #578 (#579)
hxeyexn Jan 12, 2025
180ac94
feat: 스타카토 웹 메인 페이지 생성 #576 (#577)
BurningFalls Jan 15, 2025
929de63
refactor: 화면에 반응형 디자인 적용 #597 (#598)
BurningFalls Jan 15, 2025
2dbd039
refactor: 트리거를 pr에서 push로 변경 (#600)
BurningFalls Jan 15, 2025
a49c489
feat: 추억 목록 정렬, 필터링 API 구현 #546 (#583)
linirini Jan 17, 2025
5776e7f
fix: 필터링 API 파싱 오류 수정 #604 (#605)
linirini Jan 19, 2025
8361895
refactor: comment API 버저닝 제거 #584 (#585)
linirini Jan 19, 2025
7346e49
refactor: 도메인명 변경 (memory -> category, moment -> staccato) #594 (#596)
BurningFalls Jan 19, 2025
76848c4
refactor: CallAdapter 적용 및 검증 테스트 작성 #558 (#574)
hxeyexn Jan 27, 2025
5023ce7
fix: StaccatoDetailResponse 응답값 매핑 오류 수정 #606 (#607)
linirini Jan 30, 2025
23e10cb
fix: Comment API에서 도메인명 안바뀐 부분 수정 #609 (#610)
BurningFalls Feb 1, 2025
7f58bc0
refactor: MomentImage update 시 수동 삭제 적용 #591 (#593)
Ho-Tea Feb 5, 2025
f3b1e15
feat: 프로필 이미지 변경 및 타임라인 닉네임 표시 #538 (#603)
s6m1n Feb 6, 2025
f8e3aeb
refactor: Memory -> Category 도메인명 변경 및 API URI 변경 #595 (#608)
Junyoung-WON Feb 6, 2025
9e764ab
fix: LogBack appender xml 수정 #590 (#614)
BurningFalls Feb 6, 2025
3d9a2d1
feat: 필터링/조건 옵션 로깅 구현 #601 (#615)
linirini Feb 6, 2025
eea1669
feat: 기록 시점이 과거 / 현재 / 미래인지 비즈니스 매트릭 구성 #611 (#612)
Ho-Tea Feb 6, 2025
0a9c736
deploy: v.1.3.0 배포 준비 #613 (#619)
Junyoung-WON Feb 6, 2025
0ab58af
fix: Merge Conflict 해결
Junyoung-WON Feb 6, 2025
87dc69f
deploy: v.1.3.0 배포 준비 #621 (#622)
BurningFalls Feb 6, 2025
613524b
deploy: v.1.3.0 배포 준비 #621 (#623)
BurningFalls Feb 6, 2025
6384140
fix: 머지 충돌 해결
BurningFalls Feb 6, 2025
c53899b
build: Android CI&CD 수정 #624 (#625)
Junyoung-WON Feb 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions .github/workflows/android-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,18 @@ jobs:
run: ./gradlew bundleRelease

- name: Upload Release APK in artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: app-release.apk
path: android/Staccato_AN/app/build/outputs/apk/release/app-release.apk
overwrite: 'true'

- name: Upload Release AAB in artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: app-release.aab
path: android/Staccato_AN/app/build/outputs/bundle/release/app-release.aab
overwrite: 'true'

- name: Deploy AAB On Google Play Console
uses: r0adkll/upload-google-play@v1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/android-ci-cd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ jobs:
run: ./gradlew assembleRelease

- name: Upload Release APK
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: app-release.apk
path: android/Staccato_AN/app/build/outputs/apk/release/app-release.apk
overwrite: 'true'

- name: Upload Artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/backend-ci-cd-dev.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Backend CI/CD dev

on:
push:
paths: [ 'backend/**', '.github/**' ]
branches: [ "develop-be", "develop" ]
workflow_dispatch:

jobs:
ci:
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/backend-ci-cd-multi-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Backend CI/CD multi dev

on:
push:
paths: [ 'backend/**', '.github/**' ]
branches: [ "develop" ]

jobs:
ci:
runs-on: [ self-hosted, dev ]

defaults:
run:
shell: bash
working-directory: ./backend

permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Setup with Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Build with Gradle
run: ./gradlew clean build

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_DEPLOY_USERNAME }}
password: ${{ secrets.DOCKERHUB_DEPLOY_TOKEN }}

- name: Docker Image Build
run: |
sudo docker build --platform linux/arm64 -t staccato/staccato:dev -f Dockerfile.dev .

- name: Docker Hub Push
run: |
sudo docker login --username ${{ secrets.DOCKERHUB_DEPLOY_USERNAME }} --password ${{ secrets.DOCKERHUB_DEPLOY_TOKEN }}
sudo docker push staccato/staccato:dev

cd:
needs: ci
runs-on: [ self-hosted, dev ]

steps:
- name: Run deploy script
id: run_deploy
run: bash /home/ubuntu/staccato/deploy.sh
# 스크립트가 exit 1이면 여기서 스텝 실패

- name: Check result # 여기서 롤백전략
if: steps.run_deploy.conclusion == 'failure'
run: bash /home/ubuntu/staccato/rollback.sh

port_switch:
needs: cd
runs-on: [ self-hosted, dev ]
if: ${{ success() }} # cd job의 matrix 모두 성공해야 success -> 현재는 matrix 지정은 하지 않은 상태
steps:
- name: Switch Nginx Ports
run: bash /home/ubuntu/staccato/switch.sh
4 changes: 0 additions & 4 deletions .github/workflows/backend-ci-cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ jobs:
needs: ci
runs-on: [ self-hosted, prod ]

strategy:
matrix:
runner: [ prod-a, prod-b ]

steps:
- name: execute deploy.sh
run: bash /home/ubuntu/staccato/deploy.sh
32 changes: 29 additions & 3 deletions android/Staccato_AN/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import java.io.FileInputStream
import java.util.Properties

Expand All @@ -20,6 +21,7 @@ plugins {
alias(libs.plugins.firebaseCrashlytics)
alias(libs.plugins.mapsplatformSecretsGradlePlugin)
alias(libs.plugins.hiltAndroid)
alias(libs.plugins.androidJunit5)
}

android {
Expand All @@ -30,10 +32,12 @@ android {
applicationId = "com.on.staccato"
minSdk = 26
targetSdk = 34
versionCode = 7
versionName = "1.2.1"
versionCode = 8
versionName = "1.3.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["runnerBuilder"] =
"de.mannodermaus.junit5.AndroidJUnit5Builder"

buildConfigField("String", "TOKEN", "${localProperties["token"]}")
}
Expand Down Expand Up @@ -98,9 +102,17 @@ dependencies {
implementation(libs.androidx.activity)
implementation(libs.androidx.constraintlayout)
testImplementation(libs.junit)
testImplementation(libs.androidx.arch.core)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)

// JUnit5
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.vintage.engine)

// AssertJ
testImplementation(libs.assertj.core)

// Glide
implementation(libs.glide)

Expand All @@ -117,6 +129,7 @@ dependencies {

// OkHttp
implementation(libs.okhttp.logging.interceptor)
testImplementation(libs.okhttp.mockwebserver)

// Lifecycle
implementation(libs.lifecycle.viewmodel)
Expand All @@ -139,9 +152,15 @@ dependencies {
// Fragment
implementation(libs.androidx.fragment.ktx)

// Coroutines Test
testImplementation(libs.kotlinx.coroutines.test)

// Mockk
testImplementation(libs.mockk.android)
testImplementation(libs.junitparams)
testImplementation(libs.mockk)
testImplementation(libs.mockk.agent)
androidTestImplementation(libs.mockk.agent)
androidTestImplementation(libs.mockk.android)

// Navigation
implementation(libs.androidx.navigation.fragment.ktx)
Expand Down Expand Up @@ -181,3 +200,10 @@ secrets {
ignoreList.add("keyToIgnore")
ignoreList.add("sdk.*")
}

tasks.withType<Test> {
testLogging {
events("started", "passed", "skipped", "failed", "standardError", "standardOut")
exceptionFormat = TestExceptionFormat.FULL
}
}
4 changes: 2 additions & 2 deletions android/Staccato_AN/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
android:screenOrientation="portrait" />

<activity
android:name=".presentation.memoryupdate.MemoryUpdateActivity"
android:name=".presentation.categoryupdate.CategoryUpdateActivity"
android:exported="false"
android:screenOrientation="portrait" />

Expand All @@ -85,7 +85,7 @@
android:screenOrientation="portrait" />

<activity
android:name=".presentation.memorycreation.MemoryCreationActivity"
android:name=".presentation.categorycreation.CategoryCreationActivity"
android:exported="false"
android:screenOrientation="portrait" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ package com.on.staccato
import android.app.Application
import com.google.android.libraries.places.api.net.PlacesClient
import com.on.staccato.data.PlacesClientProvider
import com.on.staccato.data.StaccatoClient
import com.on.staccato.data.UserInfoPreferencesManager
import dagger.hilt.android.HiltAndroidApp
import retrofit2.Retrofit

@HiltAndroidApp
class StaccatoApplication : Application() {
override fun onCreate() {
super.onCreate()
// AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
retrofit = StaccatoClient.initialize()
userInfoPrefsManager = UserInfoPreferencesManager(applicationContext)
placesClient = PlacesClientProvider.getClient(this)
}

companion object {
lateinit var retrofit: Retrofit
lateinit var userInfoPrefsManager: UserInfoPreferencesManager
lateinit var placesClient: PlacesClient
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.on.staccato.data

import com.on.staccato.data.dto.Status

sealed interface ApiResult<T>

class Success<T>(val data: T) : ApiResult<T>

class ServerError<T>(val status: Status, val message: String) : ApiResult<T>

sealed class Exception<T> : ApiResult<T> {
class NetworkError<T> : Exception<T>()

class UnknownError<T> : Exception<T>()
}

inline fun <T, R> ApiResult<T>.handle(convert: (T) -> R): ApiResult<R> =
when (this) {
is Exception.NetworkError -> Exception.NetworkError()
is Exception.UnknownError -> Exception.UnknownError()
is ServerError -> ServerError(status, message)
is Success -> Success(convert(data))
}

fun ApiResult<Unit>.handle(): ApiResult<Unit> =
when (this) {
is Exception.NetworkError -> Exception.NetworkError()
is Exception.UnknownError -> Exception.UnknownError()
is ServerError -> ServerError(status, message)
is Success -> Success(data)
}
Loading