As-is
To-be
Migration CI/CD
CircleCI 선택 이유
기존 CI 에서의 해결하고자 했던 문제
NPM 패키지 배포 스크립트 예시
# .circleci/config.yml
version: 2.1
orbs:
node: circleci/[email protected]
jobs:
publish:
executor:
name: node/default
tag: '16.15.0'
steps:
- checkout
- run:
name: Set Scope
command: npm set @<SCOPE_ORG_NAME>:registry=https://npm.pkg.github.com
- run:
name: Authorize to NPM
command: npm set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
- run:
name: Install Dependency
command: yarn install --frozen-lockfile
- run:
name: Build Package
command: yarn build
- run:
name: Publish to Private NPM
command: npm publish
workflows:
publish-workflow:
jobs:
- publish:
# organization setting - context 이름, 조직에서 관리되는 환경 변수 사용 가능
# context 사용하지 않으면 project setting - env variable 에서 설정해줘야 함
context:
- <CONTEXT_NAME>
# filters - OR 연산으로 작동 (따라서, tags & branch 동시에 작동됨)
filters:
tags:
only: /^v\\d+\\.\\d+\\.\\d+$/ # ex) v0.0.101
branches:
ignore: /.*/ # 모든 브랜치 ignore trigger
전체적인 평가
AWS Codebuild 컴퓨팅 환경