Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- Shell
- UIPATH
- Git
- gitlab-runner
- sonar-qube
- docker
- UiARD
- Oracle
- UiPATH #UiRPA #RPA
- container-registry
- gitlab
- MaxGauge
- gitlab-ci
- Xen
- RPA
- runner
- PostgreSQL
Archives
- Today
- Total
올챙이시절 기록소
Gitlab CI Variables 환경변수 알아보기 본문
ref : Gitlab CI > Variables
GitLab CI를 사용하여 Runner를 쓸 때,
기본적으로 세팅되어 있는 환경변수를 쓰면 편리한 경우가 있다
ex ) 동일한 컨테이너를 쓰는데 현 프로젝트를 알아야 하는 경우
CI_PROJECT_NAME
ex ) 정규표현식으로 걸러진 tag에만 수행하도록 설계된 Pipeline에서 트리거가 걸린 Tag의 값을 확인할 때
CI_COMMIT_TAG
ex ) 채팅앱으로 Pipeline Status View 연계 링크에 필요한 Pipeline 번호를 확인할 때
CI_PIPELINE_ID
( 쉘에서 이렇게 "$CI_PIPELINE_ID" 변수의 값을 쓰는 것이다 )
·
·
·
여하튼, 여러가지 경우에 요긴하다
Gitlab은 문서가 정말 잘 만들어져 있어 자동화하기에 최고다
Predefined variables (Environment variables)
Some of the predefined environment variables are available only if a minimum version of GitLab Runner is used. Consult the table below to find the version of Runner required.
Variable | GitLab | Runner | Description |
---|---|---|---|
CI | all | 0.4 | Mark that job is executed in CI environment |
CI_COMMIT_REF_NAME | 9.0 | all | The branch or tag name for which project is built |
CI_COMMIT_REF_SLUG | 9.0 | all | $CI_COMMIT_REF_NAME lowercased, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with - . No leading / trailing - . Use in URLs, host names and domain names. |
CI_COMMIT_SHA | 9.0 | all | The commit revision for which project is built |
CI_COMMIT_TAG | 9.0 | 0.5 | The commit tag name. Present only when building tags. |
CI_CONFIG_PATH | 9.4 | 0.5 | The path to CI config file. Defaults to .gitlab-ci.yml |
CI_DEBUG_TRACE | all | 1.7 | Whether debug tracing is enabled |
CI_DISPOSABLE_ENVIRONMENT | all | 10.1 | Mark that job is executed in a disposable environment (something that is created only for this job and disposed of/destroyed after the execution - all executors except shell and ssh ). If the environment is disposable, it is set to true, otherwise it is not defined at all. |
CI_ENVIRONMENT_NAME | 8.15 | all | The name of the environment for this job |
CI_ENVIRONMENT_SLUG | 8.15 | all | A simplified version of the environment name, suitable for inclusion in DNS, URLs, Kubernetes labels, etc. |
CI_ENVIRONMENT_URL | 9.3 | all | The URL of the environment for this job |
CI_JOB_ID | 9.0 | all | The unique id of the current job that GitLab CI uses internally |
CI_JOB_MANUAL | 8.12 | all | The flag to indicate that job was manually started |
CI_JOB_NAME | 9.0 | 0.5 | The name of the job as defined in .gitlab-ci.yml |
CI_JOB_STAGE | 9.0 | 0.5 | The name of the stage as defined in .gitlab-ci.yml |
CI_JOB_TOKEN | 9.0 | 1.2 | Token used for authenticating with the GitLab Container Registry |
CI_REPOSITORY_URL | 9.0 | all | The URL to clone the Git repository |
CI_RUNNER_DESCRIPTION | 8.10 | 0.5 | The description of the runner as saved in GitLab |
CI_RUNNER_ID | 8.10 | 0.5 | The unique id of runner being used |
CI_RUNNER_TAGS | 8.10 | 0.5 | The defined runner tags |
CI_PIPELINE_ID | 8.10 | 0.5 | The unique id of the current pipeline that GitLab CI uses internally |
CI_PIPELINE_TRIGGERED | all | all | The flag to indicate that job was triggered |
CI_PIPELINE_SOURCE | 10.0 | all | The source for this pipeline, one of: push, web, trigger, schedule, api, external. Pipelines created before 9.5 will have unknown as source |
CI_PROJECT_DIR | all | all | The full path where the repository is cloned and where the job is run |
CI_PROJECT_ID | all | all | The unique id of the current project that GitLab CI uses internally |
CI_PROJECT_NAME | 8.10 | 0.5 | The project name that is currently being built (actually it is project folder name) |
CI_PROJECT_NAMESPACE | 8.10 | 0.5 | The project namespace (username or groupname) that is currently being built |
CI_PROJECT_PATH | 8.10 | 0.5 | The namespace with project name |
CI_PROJECT_PATH_SLUG | 9.3 | all | $CI_PROJECT_PATH lowercased and with everything except 0-9 and a-z replaced with - . Use in URLs and domain names. |
CI_PROJECT_URL | 8.10 | 0.5 | The HTTP address to access project |
CI_REGISTRY | 8.10 | 0.5 | If the Container Registry is enabled it returns the address of GitLab's Container Registry |
CI_REGISTRY_IMAGE | 8.10 | 0.5 | If the Container Registry is enabled for the project it returns the address of the registry tied to the specific project |
CI_REGISTRY_PASSWORD | 9.0 | all | The password to use to push containers to the GitLab Container Registry |
CI_REGISTRY_USER | 9.0 | all | The username to use to push containers to the GitLab Container Registry |
CI_SERVER | all | all | Mark that job is executed in CI environment |
CI_SERVER_NAME | all | all | The name of CI server that is used to coordinate jobs |
CI_SERVER_REVISION | all | all | GitLab revision that is used to schedule jobs |
CI_SERVER_VERSION | all | all | GitLab version that is used to schedule jobs |
CI_SHARED_ENVIRONMENT | all | 10.1 | Mark that job is executed in a shared environment (something that is persisted across CI invocations like shell or ssh executor). If the environment is shared, it is set to true, otherwise it is not defined at all. |
ARTIFACT_DOWNLOAD_ATTEMPTS | 8.15 | 1.9 | Number of attempts to download artifacts running a job |
GET_SOURCES_ATTEMPTS | 8.15 | 1.9 | Number of attempts to fetch sources running a job |
GITLAB_CI | all | all | Mark that job is executed in GitLab CI environment |
GITLAB_USER_ID | 8.12 | all | The id of the user who started the job |
GITLAB_USER_EMAIL | 8.12 | all | The email of the user who started the job |
GITLAB_USER_LOGIN | 10.0 | all | The login username of the user who started the job |
GITLAB_USER_NAME | 10.0 | all | The real name of the user who started the job |
RESTORE_CACHE_ATTEMPTS | 8.15 | 1.9 | Number of attempts to restore the cache running a job |
'2016 > 8월' 카테고리의 다른 글
Git - 빈디렉토리를 형상관리 할 때 (0) | 2017.10.25 |
---|---|
Xen Storage 관리편 - VM Resize 하기 (0) | 2017.10.24 |
빌드시스템의 Table & Procedure 관련정리 (0) | 2017.10.16 |
이노셋업 - 패키징스크립트 내 Sections분석 ( InnoSetup ) (4) | 2017.09.27 |
이노셋업이란 무엇인가 - 자동 설치 패키징도구 (feat. Inno Setup) (0) | 2017.09.21 |
Comments