InfoGrab Docs

다른 파일에서 CI/CD 구성 사용

`include` 키워드를 사용하여 다른 YAML 파일의 내용으로 CI/CD 구성을 확장합니다.

include 를 사용하여 CI/CD 잡에 외부 YAML 파일을 포함할 수 있습니다. 단일 구성 파일 포함 # 단일 구성 파일을 포함하려면 다음 구문 옵션 중 하나를 사용하여 단일 파일과 함께 include 를 사용합니다: 같은 줄에: include: 'my-config.yml' 배열의 단일 항목으로: include: - 'my-config.yml' 파일이 로컬 파일인 경우 동작은 include:local 과 동일합니다. 파일이 원격 파일인 경우 include:remote 와 동일합니다. 구성 파일 배열 포함 # 구성 파일 배열을 포함할 수 있습니다: include 유형을 지정하지 않으면 각 배열 항목은 필요에 따라 기본적으로 include:local 또는 include:remote 로 설정됩니다: include: - 'https://gitlab.com/awesome-project/raw/main/.before-script-template.yml' - 'templates/.after-script-template.yml' 단일 항목 배열을 정의할 수 있습니다: include: - remote: 'https://gitlab.com/awesome-project/raw/main/.before-script-template.yml' 배열을 정의하고 여러 include 유형을 명시적으로 지정할 수 있습니다: include: - remote: 'https://gitlab.com/awesome-project/raw/main/.before-script-template.yml' - local: 'templates/.after-script-template.yml' - template: Auto-DevOps.gitlab-ci.yml 기본 및 특정 include 유형을 모두 결합하는 배열을 정의할 수 있습니다: include: - 'https://gitlab.com/awesome-project/raw/main/.before-script-template.yml' - 'templates/.after-script-template.yml' - template: Auto-DevOps.gitlab-ci.yml - project: 'my-group/my-project' ref: main file: 'templates/.gitlab-ci-template.yml' 포함된 구성 파일에서 default 구성 사용 # 구성 파일에 default 섹션을 정의할 수 있습니다. include 키워드와 함께 default 섹션을 사용하면 기본값이 파이프라인의 모든 잡에 적용됩니다. 예를 들어, before_script 와 함께 default 섹션을 사용할 수 있습니다. /templates/.before-script-template.yml 이라는 사용자 정의 구성 파일의 내용: default: before_script: - apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev nodejs - gem inst