GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › ci/cd yaml syntax reference
CI/CD YAML syntax reference | GitLab Docs
The YAML file must have the extension .yml or .yaml. You can use * and ** wildcards in the file path. You can use certain CI/CD variables. ... The .gitlab-ci.yml file and the local file must be on the same branch.
Getting started
Use CI/CD variables to customize jobs by making values defined elsewhere accessible to jobs. You can hard-code CI/CD variables in your .gitlab-ci.yml file, set them in your project settings, or generate them dynamically.
CI/CD inputs
Inputs provide advantages over variables including type checking, validation, and a clear contract. Unexpected inputs are rejected. Inputs for pipelines must be defined in the spec:inputs header of the main .gitlab-ci.yml file.
CI/CD variables
Variables saved in the .gitlab-ci.yml file are visible to all users with access to the repository, and should store only non-sensitive project configuration. For example, the URL of a database saved in a DATABASE_URL variable.
Pipelines
CI/CD pipelines are the fundamental component of GitLab CI/CD. Pipelines are configured in a .gitlab-ci.yml file by using YAML keywords.
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › getting started
Get started with GitLab CI/CD | GitLab Docs
The .gitlab-ci.yml file defines the stages, jobs, and scripts that make up your CI/CD pipeline, including variables, job dependencies, and when and how each job runs.
gitlab-ci.yaml management
Yes, there is a lot you can do. you can use extends: to reuse configuration. https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#use-extends-to-reuse-configuration-sections You can put scripts in their own files. Don't forget to make them executable before you commit them, so you don't have to run chmod +x on them every time. You can use include to have smaller files and put merge them in a .gitlab-ci,yml https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#use-extends-and-include-together There are few more things you can do. What I wouldn't do, is to use yaml anchors. extends: is cleaner and has a simpler syntax. More on reddit.com
Purpose of '.' in gitlab-ci.yml file
Hello, I am new to Gitlab and trying to understand existing gitlab-ci.yml files. I have gone through below include section in the file, where i have noticed ‘.’ below the file name in file: “.poc-template-v4.yml”. What is that purpose of ‘.’ please help me know. include: - project: ... More on forum.gitlab.com
08:46
Episode-44 | GitLab | How to create .gitlab-ci.yml file in GitLab ...
GitLab CI/CD Pipeline Tutorial for Beginners - YouTube
16:40
How to Create .gitlab-ci.yml file in GitLab | Create and Run your ...
05:33
How to create .gitlab-ci.yml file in GitLab (From Scratch) - YouTube
14:13
Gitlab CI Yml File Tutorial - Learn How to Configure It - YouTube
32:28
Gitlab yaml file simply explained - YouTube
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › tutorials › tutorial: your first pipeline
Tutorial: Create and run your first GitLab CI/CD pipeline | GitLab Docs
Create a .gitlab-ci.yml file at the root of your repository.
GitHub
github.com › SocialGouv › gitlab-ci-yml
GitHub - SocialGouv/gitlab-ci-yml: Reusable Giltlab pipelines · GitHub
include: - project: SocialGouv/gitlab-ci-yml file: /base_docker_kubectl_image_stage.yml ref: v23.3.4 - project: SocialGouv/gitlab-ci-yml file: /base_create_namespace_stage.yml ref: v23.3.4 # Create namespace: extends: .base_create_namespace_stage variables: # The rancher project where the namespaces will be created RANCHER_PROJECT_ID: <rancher_project_id> # Optional REMOTE_URL: "https://github.com/${CI_PROJECT_PATH}.git" before_script: - K8S_NAMESPACE=my-namespace # (re)create to ensure a new namespaces will be created # - kubectl delete namespaces ${K8S_NAMESPACE} || true
Author: SocialGouv
Reddit
reddit.com › r/gitlab › gitlab-ci.yaml management
r/gitlab on Reddit: gitlab-ci.yaml management
January 18, 2024 -
I am doing a project on Gitlab and the CI pipeline file is getting quite large (500+ lines) and complex and I can only see it growing.
Is this common? And are there any tips for general management of pipeline file size and complexity? Should some of the complexity be broken out into scripts to increase readability?
Top answer 1 of 5
10
Yes, there is a lot you can do. you can use extends: to reuse configuration. https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#use-extends-to-reuse-configuration-sections You can put scripts in their own files. Don't forget to make them executable before you commit them, so you don't have to run chmod +x on them every time. You can use include to have smaller files and put merge them in a .gitlab-ci,yml https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#use-extends-and-include-together There are few more things you can do. What I wouldn't do, is to use yaml anchors. extends: is cleaner and has a simpler syntax.
2 of 5
5
Gitlab itself is hosted on GitLab. You can check their repo for inspiration. https://gitlab.com/gitlab-org/gitlab One thing I like is that they put numerous gitlab ci files in the .gitlab/ci folder and include them all at once with: include: - local: .gitlab/ci/*.gitlab-ci.yml rules: - <<: *if-not-security-canonical-sync
GitLab
forum.gitlab.com › gitlab ci/cd
Purpose of '.' in gitlab-ci.yml file - GitLab CI/CD - GitLab Forum
June 20, 2023 - Hello, I am new to Gitlab and trying to understand existing gitlab-ci.yml files. I have gone through below include section in the file, where i have noticed ‘.’ below the file name in file: “.poc-template-v4.yml”. What is that purpose of ‘.’ please help me know. include: - project: ...
GitLab
gitlab.com › gitlab.org › repository
.gitlab-ci.yml · master · GitLab.org / GitLab · GitLab
if: '($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_EVENT_TYPE != "merge_train") && $CI_MERGE_REQUEST_LABELS =~ /pipeline:run-with-rails-next/' ... workflow: name: '$PIPELINE_NAME' rules: # https://gitlab.com/gitlab-org/gitlab/-/issues/514740 - if: '$GITLAB_USER_LOGIN == "gitlab-crowdin-bot" && $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_APPROVED != "true"' when: never - if: '$CI_PIPELINE_SOURCE == "pipeline" && $GITALY_TEST' variables: <<: *default-ruby-variables PIPELINE_NAME: 'Gitaly Rails Test Pipeline' - <<: *if-triggered-by-aigw-project variables: <<: *default-ruby-variables PIPELINE_NAME: 'AIGW Rails Test Pipeline' # If `$FORCE_GITLAB_CI` is set, create a pipeline.
GitHub
hsf-training.github.io › hsf-training-cicd › 04-understanding-yaml-and-ci › index.html
YAML and CI – Continuous Integration / Continuous Deployment (CI/CD) with GitLab
1 week ago - The GitLab CI configurations are specified using a YAML file called .gitlab-ci.yml.
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › jobs
CI/CD Jobs | GitLab Docs
To add a job to a pipeline, add it into your .gitlab-ci.yml file.
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › pipelines
CI/CD pipelines | GitLab Docs
CI/CD pipelines are the fundamental component of GitLab CI/CD. Pipelines are configured in a .gitlab-ci.yml file by using YAML keywords.
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › tutorials › ci/cd examples
CI/CD examples | GitLab Docs
Examples and community-contributed guides for implementing GitLab CI/CD across languages, frameworks, and deployment targets.