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.
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
This example shows four jobs: build-job, test-job1, test-job2, and deploy-prod. The comments listed in the echo commands are displayed in the UI when you view the jobs. The values for the predefined variables $GITLAB_USER_LOGIN and $CI_COMMIT_BRANCH are populated when the jobs run.
How make a if statement in the CI file
Have somebody a simple example how to make if conditions in the CI file for GitLab Runner · I’m afraid, this is not possible in the relatively static YAML configuration language. I would write a small bash script which reads the environment variables CI_MERGE_REQUEST_ID and does the printing ... More on forum.gitlab.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
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
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 › ci/cd yaml syntax reference
CI/CD YAML syntax reference | GitLab Docs
include: - remote: 'https://gitlab.com/example-project/-/raw/main/.gitlab-ci.yml' integrity: 'sha256-L3/GAoKaw0Arw6hDCKeKQlV1QPEgHYxGBHsH4zG1IY8='
Hifis
hifis.net › workshop-materials › gitlab-ci › episodes › 08-using-includes
Using Includes - Continuous Integration in GitLab
As demonstrated above, the simplest way to include YAML files in another one is to put the file to include somewhere in the same project and reference it with the include:local sub-key in the main YAML file .gitlab-ci.yml by using the relative path from the project root to the YAML file to include.
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
For example, the inputs context allows you to access information passed into the configuration file from a parent file or when a pipeline is run. 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 ...
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
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › jobs
CI/CD Jobs | GitLab Docs
To create a group of jobs, in the .gitlab-ci.yml file, separate each job name with a number and one of the following: A forward or backward slash (/ or \), for example, slash-test 1/3, slash-test 2/3, slash-test 3/3.
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › ci/cd components › ci/cd component examples
CI/CD component examples | GitLab Docs
- docker push $CI_REGISTRY_IMAGE/my-tool:$CI_COMMIT_TAG create-release: stage: release image: registry.gitlab.com/gitlab-org/cli:latest script: echo "Creating release $CI_COMMIT_TAG" rules: - if: $CI_COMMIT_TAG release: tag_name: $CI_COMMIT_TAG description: "Release $CI_COMMIT_TAG" In the component template (templates/my-component/template.yml):
GitLab
forum.gitlab.com › gitlab ci/cd
How make a if statement in the CI file - GitLab CI/CD - GitLab Forum
July 14, 2020 - Have somebody a simple example how to make if conditions in the CI file for GitLab Runner · I’m afraid, this is not possible in the relatively static YAML configuration language. I would write a small bash script which reads the environment variables CI_MERGE_REQUEST_ID and does the printing ...
Medium
medium.com › globant › optimize-pipeline-implementation-using-gitlab-ci-templates-6eef54046231
Optimize pipeline implementation using GitLab CI Templates | by Francisco Andre Aranguren Torres | Globant | Medium
March 8, 2023 - You will have a stable version where only major version releases can introduce breaking changes, while in the latest version any change can be a breaking change. The GitLab team distinguishes those versions using different files (for example, Deploy.yml for the latest version and Deploy.gitlab-ci.yml for the stable version).
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: "XXX/infrastructure/ci-templates" ref: "main" file: ".poc-template-v4.yml" - project: 'XXX/infrastructure/ci-templates' ref: "main" file: '.poc-node-ci-template.yml' Thanks & Regards Srivatsas...
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