Go to navigation

CI/CD (Automation)

Automation in GitLab (specifically GitLab CI/CD) allows users to automatically run user-defined scripts.

It can be used, for example, to compile and build a project, run automated tests, perform quality checks and code formatting, and automatically deploy an application to a test or production environment. Individual steps are triggered by events such as committing changes to a repository, creating a merge request, or releasing a new version.

All authenticated users of the faculty GitLab are permitted to use automation features.

Configuration

  1. After logging in to the faculty GitLab, create a new repository or navigate to an existing one for which you want to set up CI/CD.
  2. In the project’s root directory, create a file named .gitlab-ci.yml and paste the following content into the file:

    stages:
      - build
      - test
    
    build:
      stage: build
      script:
        - echo "Building project"
    
    test:
      stage: test
      script:
        - echo "Running tests"
  3. Save and push the changes to the repository.
  4. At this point, GitLab will begin processing the individual jobs defined in .gitlab-ci.yml.
  5. You can view the progress of the entire process by clicking the Build  Pipelines menu item in the left-hand menu.