__CAPGO_KEEP_10__
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 명령어를 복사하세요.
Integrate Capgo Live Updates with GitLab CI/CD to automatically deploy your app updates whenever you push code changes. This guide covers setting up automated builds, testing, and deployment workflows.
GitLab CI/CD와 __CAPGO_KEEP_0__ Live Updates를 통합하여 __CAPGO_KEEP_1__ 변경 사항을 푸시할 때마다 앱 업데이트를 자동으로 배포하세요.
설치 전 요구 사항GitLab CI/CD 통합을 설정하기 전에 다음을 확인하세요:
- GitLab 계정과 프로젝트 저장소
- Capgo 계정과 앱이 설정된 Capgo
- Node.js와 npm/yarn이 프로젝트에 설정된 경우
GitLab CI/CD 설정
설치 요구 사항1단계: 환경 변수 설정
1단계: 환경 변수 설정먼저 GitLab 프로젝트에서 필요한 변수를 설정하세요:
- 프로젝트로 이동하세요
- GitLab 프로젝트로 이동하세요 설정 → CI/CD → 변수
- 다음 변수를 추가하세요:
| 변수 이름 | 값 | 보호 | 가려진 |
|---|---|---|---|
CAPGO_TOKEN | Your Capgo API 토큰 | ✅ 예 | ✅ 예 |
Copy to clipboard
# .gitlab-ci.yml - Simple Configurationimage: node:22
stages: - build - deploy
variables: npm_config_cache: "$CI_PROJECT_DIR/.npm"
build: stage: build script: - npm ci - npm run test - npm run build artifacts: paths: - dist/ expire_in: 1 hour only: - main
deploy_production: stage: deploy script: - npm install -g @capgo/cli - npx @capgo/cli bundle upload --apikey $CAPGO_TOKEN --channel production # For encrypted uploads, add: --key-data-v2 "$CAPGO_PRIVATE_KEY" dependencies: - build only: - main고급 설정
기능 branch 배포__CAPGO_KEEP_0__ __CAPGO_KEEP_1__
기능 branch 배포기능 branch를 테스트 채널에 배포하여 검토 및 테스트:
# Feature branch deploymentdeploy_feature: stage: deploy script: - npm install -g @capgo/cli - CHANNEL_NAME="feature-$(echo $CI_COMMIT_REF_NAME | sed 's/[^a-zA-Z0-9-]/-/g')" - npx @capgo/cli channel create $CHANNEL_NAME --apikey $CAPGO_TOKEN || true - npx @capgo/cli bundle upload --apikey $CAPGO_TOKEN --channel $CHANNEL_NAME dependencies: - build only: - /^feature\/.*$/ environment: name: feature/$CI_COMMIT_REF_NAME url: https://your-app.com/channels/$CHANNEL_NAME암호화 사용
기능 제목 “암호화 사용”만약 __CAPGO_KEEP_0__의 암호화 기능을 사용 중이라면 Capgo’s encryption feature__CAPGO_KEEP_0__
설정 후 로컬에서 암호화 키를 설정한 후 GitLab 변수에 개인 키를 추가하세요:
# Display your private key content (copy this output)cat .capgo_key_v2GitLab 프로젝트 변수에 다음 내용을 추가하세요 (보호 및 가려진 상태로 마크하고) CAPGO_PRIVATE_KEY 복사
# Deploy with encryptiondeploy_production: script: - npm install -g @capgo/cli - npx @capgo/cli bundle upload --apikey $CAPGO_TOKEN --key-data-v2 "$CAPGO_PRIVATE_KEY" --channel productionMulti-Channel Configuration
Multi-Channel ConfigurationFor comprehensive information about setting up and managing multiple deployment channels, see the Channels.
Complete configuration with multiple environments and merge request deployments:
# .gitlab-ci.yml - Advanced Multi-Channel Configurationimage: node:22
stages: - build - deploy
variables: npm_config_cache: "$CI_PROJECT_DIR/.npm"
# Build stagebuild: stage: build script: - npm ci - npm run test - npm run build artifacts: paths: - dist/ expire_in: 24 hours
# Deploy to development channeldeploy_development: stage: deploy script: - npm install -g @capgo/cli - npx @capgo/cli bundle upload --apikey $CAPGO_TOKEN --channel development dependencies: - build only: - develop environment: name: development
# Deploy merge requests to test channelsdeploy_mr: stage: deploy script: - npm install -g @capgo/cli - CHANNEL_NAME="mr-$CI_MERGE_REQUEST_IID" - npx @capgo/cli channel create $CHANNEL_NAME --apikey $CAPGO_TOKEN || true - npx @capgo/cli bundle upload --apikey $CAPGO_TOKEN --channel $CHANNEL_NAME dependencies: - build only: - merge_requests environment: name: review/$CI_MERGE_REQUEST_IID url: https://your-app.com/channels/mr-$CI_MERGE_REQUEST_IID on_stop: cleanup_mr
# Cleanup MR channels when MR is closedcleanup_mr: stage: deploy script: - npm install -g @capgo/cli - npx @capgo/cli channel delete mr-$CI_MERGE_REQUEST_IID --apikey $CAPGO_TOKEN || true when: manual environment: name: review/$CI_MERGE_REQUEST_IID action: stop only: - merge_requests
# Deploy to stagingdeploy_staging: stage: deploy script: - npm install -g @capgo/cli - npx @capgo/cli bundle upload --apikey $CAPGO_TOKEN --channel staging dependencies: - build only: - develop environment: name: staging
# Deploy to productiondeploy_production: stage: deploy script: - npm install -g @capgo/cli - npx @capgo/cli bundle upload --apikey $CAPGO_TOKEN --channel production dependencies: - build only: - main environment: name: productionMulti-Environment with Manual Approval
Multi-Environment with Manual Approval__CAPGO_KEEP_0__ 프로덕션 배포에 대한 수동 승인 요구가 있는 경우:
deploy_production: stage: deploy script: - npm install -g @capgo/cli - npx @capgo/cli bundle upload --apikey $CAPGO_TOKEN --channel production dependencies: - build only: - main when: manual environment: name: productionBranch-Based 배포 전략
Branch-Based 배포 전략적절한 채널로 자동으로 다른 branch를 배포하십시오:
# Dynamic channel deployment based on branchdeploy: stage: deploy script: - npm install -g @capgo/cli - | if [ "$CI_COMMIT_REF_NAME" = "main" ]; then CHANNEL="production" elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then CHANNEL="staging" else CHANNEL="development" fi - npx @capgo/cli bundle upload --apikey $CAPGO_TOKEN --channel $CHANNEL dependencies: - build environment: name: $CHANNEL보안 최적화
보안 최적화보호 변수
보호 변수- Sensitive 변수를 표시하십시오: __CAPGO_KEEP_0__ 토큰은 항상 보호 및 가려야 합니다.API
- Branch Protection__CAPGO_KEEP_0__을 사용하여 프로덕션 배포에 보호 변수를 사용하세요.
- Access Control유지보수자만이 변수에 접근할 수 있도록 제한하세요.
- Regular RotationAPI 토큰을 정기적으로 회전하세요.
Secure Pipeline Configuration
안전한 Pipeline 구성# Use protected variables for productiondeploy_production: stage: deploy script: - npm install -g @capgo/cli - npx @capgo/cli bundle upload --apikey $CAPGO_TOKEN --channel production only: refs: - main variables: - $CI_COMMIT_REF_PROTECTED == "true"__CAPGO_KEEP_0__을 클립보드에 복사하세요.
Monitoring and Notifications__CAPGO_KEEP_0__ 모니터링 및 알림입니다. Section titled “Monitoring and Notifications” is not translated as it is a title and not a human-readable text. However, the title is translated as below: "__CAPGO_KEEP_0__ 모니터링 및 알림". Slack Integration is not translated as it is a title and not a human-readable text. However, the title is translated as below: "__CAPGO_KEEP_0__ Slack 통합".
Slack 통합 설정Slack 알림을 pipeline에 추가하세요.
notify_success: stage: .post image: alpine:latest before_script: - apk add --no-cache curl script: - | curl -X POST -H 'Content-type: application/json' \ --data '{"text":"✅ Capgo deployment successful for '"$CI_COMMIT_REF_NAME"'"}' \ $SLACK_WEBHOOK_URL when: on_success
notify_failure: stage: .post image: alpine:latest before_script: - apk add --no-cache curl script: - | curl -X POST -H 'Content-type: application/json' \ --data '{"text":"❌ Capgo deployment failed for '"$CI_COMMIT_REF_NAME"'"}' \ $SLACK_WEBHOOK_URL when: on_failure이메일 알림
이메일 알림 설정GitLab 프로젝트 설정에서 이메일 알림을 구성하거나 API:를 사용하세요.
notify_email: stage: .post script: - | curl --request POST \ --header "PRIVATE-TOKEN: $GITLAB_API_TOKEN" \ --form "to=team@yourcompany.com" \ --form "subject=Capgo Deployment Status" \ --form "body=Deployment of $CI_COMMIT_REF_NAME completed with status: $CI_JOB_STATUS" \ "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/emails" when: always문제 해결
문제 해결일반적인 문제
일반적인 문제pipeline이 “Capgo CLI not found”로 실패합니다.
# Debug CLI installationdebug_cli: script: - npm install -g @capgo/cli - which capgo || echo "Capgo CLI not found" - npx @capgo/cli --version인증 오류:
# Verify token configurationdebug_auth: script: - | if [ -z "$CAPGO_TOKEN" ]; then echo "CAPGO_TOKEN is not set" exit 1 fi echo "Token length: ${#CAPGO_TOKEN}"빌드_artifacts_가 찾을 수 없습니다:
# List build outputsdebug_build: script: - ls -la dist/ - find dist/ -type f -name "*.js" -o -name "*.html"디버그 PIPELINE
디버그 PIPELINE 섹션문제를 해결하기 위해 디버깅 정보를 추가하세요:
debug: stage: build script: - echo "Branch: $CI_COMMIT_REF_NAME" - echo "Commit: $CI_COMMIT_SHA" - echo "Build: $CI_PIPELINE_ID" - env | grep CI_ | sort only: - branches다음 단계
다음 단계 섹션- 알아보기 채널 __CAPGO_KEEP_0__를 다르게 배포 환경을 관리하는 방법
- 탐색 고급 배포 시나리오를 위해 사용자 정의 저장소 설정
- 보안 배포를 위해 암호화 설정 업데이트 동작을 커스터마이즈하여 업데이트가 적용되는 방식을 조정
- GitLab CI/CD 통합을 통해 __CAPGO_KEEP_0__ 배포를 자동화하고 모바일 앱 사용자에게 일관된, 신뢰할 수 있는 업데이트를 보장할 수 있습니다. GitLab CI/CD 통합을 통해 __CAPGO_KEEP_0__ 배포를 자동화하고 모바일 앱 사용자에게 일관된, 신뢰할 수 있는 업데이트를 보장할 수 있습니다. GitLab CI/CD 통합을 통해 __CAPGO_KEEP_0__ 배포를 자동화하고 모바일 앱 사용자에게 일관된, 신뢰할 수 있는 업데이트를 보장할 수 있습니다.
GitLab CI/CD 통합을 통해 Capgo 배포를 자동화하고 모바일 앱 사용자에게 일관된, 신뢰할 수 있는 업데이트를 보장할 수 있습니다.