continue-config.yml:docker_layer_caching: true변경되지 않은 레이어를 재사용하여 빌드 시간을 크게 줄이다.
circleci tests split병렬 실행을 위한 테스트 분할: 사용하다
--split-by=timings과거 실행 시간을 기반으로 병렬 컨테이너에 테스트를 분산시켜 효율성을 최대화한다.
persist_to_workspace빌드 아티팩트를 유지하다
attach_workspace대신 후속 작업에서 다시 빌드하지 않고 시간을 절약하고 일관성을 보장한다.
circleci config validate워크플로우 필터 구현: 작업이 실행되는 시기를 제어하기 위해 브랜치 및 태그 필터를 사용하여 불필요한 배포를 방지하고 크레딧을 절약하면서 보안을 유지한다.
circleci local execute비밀 정보를 컨텍스트에 저장: 프로젝트 환경 변수 대신 CircleCI 컨텍스트에서 민감한 자격 증명을 관리하여 더 나은 보안, 접근 제어 및 프로젝트 간 재사용성을 확보한다.
문제
솔루션
”Config file not found” error
Ensure .circleci/config.yml exists in repository root. Run circleci config validate to check file location and syntax.
Local execution fails with Docker errors
Verify Docker is running: docker ps. Ensure the CLI has access to Docker socket. On Linux, add user to docker group: sudo usermod -aG docker $USER.
”Invalid configuration” during validation
Run circleci config process .circleci/config.yml to see expanded config and identify syntax errors. Check YAML indentation (use spaces, not tabs).
Jobs not triggering on push
Verify project is followed: circleci follow github/org/repo. Check workflow filters aren’t excluding your branch. Ensure webhook is configured in VCS settings.
Workspace attachment fails
Ensure persist_to_workspace in upstream job completes successfully. Verify root and paths match between persist and attach. Check job dependencies in workflow.
Cache not restoring
Verify cache key matches between save_cache and restore_cache. Use fallback keys: keys: [v1-{{ checksum "file" }}, v1-]. Check cache hasn’t expired (30 days).
Authentication errors with CLI
Re-run circleci setup with a valid API token. Generate new token at https://app.circleci.com/settings/user/tokens. Verify token has correct permissions.
Parallel test splitting not working
Ensure test results are stored with store_test_results. Use glob patterns that match your test files. Verify parallelism is set greater than 1.
Out of memory errors
Increase resource_class to large or xlarge. Optimize memory-intensive operations. Check for memory leaks in application code.
Context environment variables not available
Verify job uses correct context in workflow: context: context-name. Check user has access to context in organization settings. Ensure variable names don’t conflict.
Orb import fails
Verify orb exists: circleci orb info namespace/orb@version. Check version is valid. For private orbs, ensure organization has access and use --org-id flag.
- run: circleci-agent step halt크레딧 사용량 모니터링 및 최적화: 정기적으로 인사이트 및 분석을 검토하여 느린 작업을 식별하고, 병렬 처리 설정을 최적화하며, 불필요한 워크플로우 실행을 줄여 비용을 효과적으로 관리한다.