Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • hello-world-template hello-world-template
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 9
    • Issues 9
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ci-cd-discovery
  • templates
  • hello-world-templatehello-world-template
  • Issues
  • #9

Closed
Open
Created Nov 30, 2020 by Philippe Charrière@pcharriereOwner0 of 15 tasks completed0/15 tasks

09-includes

You can split your jobs into several yaml files and include these files in the main file: .gitlab-ci.yml

TODO

  • create a merge request from this issue
  • open the WebIDE
  • create a new file hello.yml with this content:
    .hello:
      image: python:slim
      tags: [docker]
      script:
        - python -c "print('hello')"
  • update the .gitlab-ci.yml file
  • include the hello.yml file:
    include: '/hello.yml'

    put it below the stages section

  • add a new stage: included
  • add a new job: say_hello belonging to included with this content:
    say_hello:
      stage: included
      extends: .hello
  • commit your changes, it will trigger the pipeline
  • observe the pipeline
  • observe the output of the pipeline
  • do the same thing for one of the other jobs of the pipeline
  • commit your changes (again)
  • observe the pipeline
  • observe the output of the pipeline
  • merge on master
Edited Dec 01, 2020 by Philippe Charrière
Assignee
Assign to
Time tracking