Skip to content

This is an example GitLab CI/CD pipeline configuration file (gitlab-ci.yml) for a Python project.

License

Notifications You must be signed in to change notification settings

Aminkomeili/example-gitlab-ci-cd-configuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Example GitLab CI/CD Configuration

This is an example GitLab CI/CD pipeline configuration file (gitlab-ci.yml) for a Python project. The pipeline includes stages for initialization, testing, and deployment. The pipeline uses various linters to validate the code, and generates linting badges as artifacts. The pipeline also includes a deployment stage that is currently empty, but can be customized to deploy the code to a server or other destination. Pipeline Stages

The pipeline includes the following stages:

  1. init: Initializes the Python environment by installing dependencies with pipenv. The virtual environment is cached to speed up future pipeline runs.
  2. test: Runs linters to validate the code. The pipeline includes the following linters:
  • pylint: Analyzes Python code and generates a score based on code quality. The pipeline generates a badge for the score.
  • black: Formats Python code to adhere to a specific style guide.
  • isort: Sorts Python imports to follow a specific style guide.
  1. deploy: An empty stage that can be customized to deploy the code to a server or other destination.

How to Use

To use this GitLab CI/CD configuration in your project:

  1. Copy the gitlab-ci.yml file to the root of your project directory.
  2. Customize the stages and linters as needed.
  3. Push the changes to your GitLab repository.
  4. Set up a GitLab CI/CD runner to execute the pipeline.

That's it! Your project should now have a CI/CD pipeline that automatically validates the code and can deploy it to a server or other destination.

License

This example GitLab CI/CD configuration is released under the MIT License. See the LICENSE file for details.

About

This is an example GitLab CI/CD pipeline configuration file (gitlab-ci.yml) for a Python project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published