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
- 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.
In the project’s root directory, create a file named
.gitlab-ci.ymland paste the following content into the file:stages: - build - test build: stage: build script: - echo "Building project" test: stage: test script: - echo "Running tests"- Save and push the changes to the repository.
- At this point, GitLab will begin processing the individual jobs defined in
.gitlab-ci.yml. - You can view the progress of the entire process by clicking the Build › Pipelines menu item in the left-hand menu.