파괴적인 변경 사항
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 명령어를 복사하세요.
이 문서는 앱에서 버전별 채널을 사용하여 깨끗한 변경 사항을 처리하는 방법을 설명합니다. 이 접근 방식은 사용자가 호환되는 업데이트를 받을 수 있도록 앱의 다양한 버전을 유지 관리할 수 있도록합니다.
예시 시나리오
예시 시나리오 제목예를 들어, 다음과 같은 경우가 있습니다:
- App version 1.2.3 (old version) - uses production channel
- App version 2.0.0 (new version with breaking changes) - uses v2 channel
- Live update 1.2.4 (compatible with 1.2.3)
- Live update 2.0.1 (compatible with 2.0.0)
전략: 메이저 버전마다 defaultChannel을 사용하세요.
전략: 메이저 버전마다 defaultChannel을 사용하세요.권장 방법: 각 메이저 버전마다 defaultChannel 을 설정하세요. 이렇게 하면 특정 사용자 그룹에 업데이트를 푸시할 수 있습니다. 동적 채널 할당에 의존하지 않습니다.
// Version 1.x releasesdefaultChannel: 'v1'
// Version 2.x releasesdefaultChannel: 'v2'
// Version 3.x releases (future)defaultChannel: 'v3'1. 새로운 버전 채널 만들기
제목 ‘1. 새로운 버전 채널 만들기’# Create channel for version 2.xnpx @capgo/cli channel create v22. Capacitor 버전 2.0.0을 위한 설정 업데이트
버전 2.0.0을 위한 Capacitor 설정 업데이트 제목Capacitor 버전 2.0.0을 위한 앱 스토어 빌드 전에 Capacitor 설정을 업데이트 하세요:
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { appId: 'com.example.app', appName: 'Example App', plugins: { CapacitorUpdater: { // ... other options defaultChannel: 'v2' // All 2.0.0 users will use v2 channel } }};
export default config;3. 별도의 Code branch를 관리하십시오
Code branch 관리앱 버전 간 호환성을 유지하기 위해 별도의 git branch를 생성하십시오.
# Create and maintain a branch for version 1.x updatesgit checkout -b v1-maintenancegit push origin v1-maintenance
# Your main branch continues with version 2.x developmentgit checkout main중요: 오래된 앱이 사용하지 않는 code/API를 사용하지 않도록 하십시오. 항상 적절한 branch에서 업데이트를 빌드하십시오.
- v1-maintenance branch1.x 앱 업데이트를 위한 (production channel)
- main branch: 2.x 앱 업데이트 (v2 채널)
4. 각 채널에 번들을 업로드
4. 각 채널에 번들을 업로드# For 1.x updates: Build from v1-maintenance branchgit checkout v1-maintenance# Make your 1.x compatible changes herenpx @capgo/cli bundle upload --channel production
# For 2.x updates: Build from main branchgit checkout main# Make your 2.x changes herenpx @capgo/cli bundle upload --channel v25. 자체 할당 활성화
5. 자체 할당 활성화# Allow apps to self-assign to v2 channelnpx @capgo/cli channel set v2 --self-assign6. 앱 스토어 배포
6. 앱 스토어 배포버전 2.0.0을 앱 스토어에 배포합니다. 이 버전을 다운로드하는 모든 사용자(새 사용자 또는 업그레이드 중인 기존 사용자)는 앱 번들에 구성된 v2 채널을 자동으로 사용합니다.
Scaling to Future Versions
Section titled “Scaling to Future Versions”버전 3.0.0을 출시할 때 더 많은 깨진 변경 사항이 있을 때:
# Create channel for version 3.xnpx @capgo/cli channel create v3// capacitor.config.ts for version 3.0.0const config: CapacitorConfig = { // ... plugins: { CapacitorUpdater: { defaultChannel: 'v3' // Version 3.x users } }};Now you can push updates to any version:
production채널 → 버전 1.x 사용자v2채널 → 버전 2.x 사용자v3채널 → 버전 3.x 사용자
7. 이주 후 정리
이주 후 정리 (7)모든 사용자가 버전 2.x로 이주한 후 (3-4 개월 후):
- 삭제
defaultChannelCapacitor 설정에서 삭제 - 채널 v2 삭제:
npx @capgo/cli channel delete v2- 버전 1-maintenance branch 삭제:
git branch -d v1-maintenancegit push origin --delete v1-maintenance배포 전에 각 채널에서 업데이트를 철저히 테스트하세요.
버전 1.x 업데이트를 유지 관리하는 방법
버전 1.x 업데이트를 유지 관리하는 방법버전 1.x와 호환되는 업데이트를 보내려면:
- __CAPGO_KEEP_0__ branch로 switch 하세요:
git checkout v1-maintenance- __CAPGO_KEEP_3__ 변경 사항을 커밋하세요:
# Make 1.x compatible changesgit add .git commit -m "Fix for v1.x"git push origin v1-maintenance- __CAPGO_KEEP_0__ 빌드 및 __CAPGO_KEEP_4__ 채널에 업로드하세요:
npx @capgo/cli bundle upload --channel production__CAPGO_KEEP_0__
__CAPGO_KEEP_0____CAPGO_KEEP_1__ __CAPGO_KEEP_2__ __CAPGO_KEEP_3__ __CAPGO_KEEP_4__ __CAPGO_KEEP_4__ __CAPGO_KEEP_4__ __CAPGO_KEEP_4__ __CAPGO_KEEP_5__ __CAPGO_KEEP_6__ __CAPGO_KEEP_7__ Beta 테스트 솔루션의 제품 워크플로우에 대해, 그리고 버전 목표 솔루션 버전 목표 솔루션의 제품 워크플로우에 대해.