gitlab 이란?
소프트웨어 개발 및 협업을 위한 올인원 솔루션을 제공하는 웹 기반 DevOps 플랫폼
| Github와 차이점은 무엇인가?
개인 또는 조직이 Git repository의 내부 관리를 제공하는데 상용할 수 있는 github
-> github의 devops 버전이라고 생각하면 편할 듯하다
!490
CI/CD 용어 정리
| Pipeline
파이프라인은 지속적 통합, 전달 및 배포의 최상위 구성 요소로 두가지로 구성됨
- Jobs: 수행할 작업 정의(컴파일 테스트)
- Stages: 작업 실행 시기 정의
-> 한 단계의 모든 Job이 성공할 경우 파이프라인은 다음 단꼐로 넘어가고 실패한 경우 종료
| Jobs
.gitlab-ci.yml파일의 가장 기본적인 요소이며 Runner가 실행되어야하는 명령 모음
job1:
script: "execute-script-for-job1"
job2:
script: "execute-script-for-job2"
| Variables
변수를 사용하여 하드코딩을 방지하고 재사용성을 높일 수 있음
| Runners
파이프라인(.gitlab-ci.yml)에 정의된 작업을 실행하는 에이전트
- WorkFlow
!512
Pipeline 예제
.gitlab-ci.yml
- 파이프라인의 구조와 순서를 정의
- gitlab runner를 사용하여 실행할 항목
- 특정 상황이 발생했을 때 실행할 항목
```yaml
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
build-job: # This job runs in the build stage, which runs first.
stage: build
script:
- echo "Compiling the code..."
- echo "Compile complete."
unit-test-job: # This job runs in the test stage.
stage: test
script:
- echo "Running unit tests..."
deploy-job: # This job runs in the deploy stage.
stage: deploy
script:
- echo "Deploying application..."
- echo "Application successfully deployed."
```
