⬆️ ⬇️

Cloud ci: travis-ci and drone.io



It is always nice to have statistics on the status of the technical part (code) of the project, coviolations.io deals with this . But to use it, you need some kind of ci-solution. Not everyone wants to raise jenkins / travis / etc on their server, and it will be easier to resort to using cloud services. We consider the two most popular: travis-ci and drone.io .



As a “sacrifice”, we will use the usual django project - the coviolations itself. For projects on ror / nodejs / flask / etc, everything will be almost the same. As a result, we get a pack of statistics and graphs .



Training



We want to check PEP8, package freshness, tests and coverage. To do this, create in the root of the project .covio.yml :

 violations: pep8: pep8 . --exclude='*migrations*,*settings*,*components*,*docs*' sloccount: sloccount . py_unittest: command: coverage run manage.py test violations projects tasks services coviolations_web push stderr: true coverage: coverage report pip_review: command: pip-review nofail: true 


All checks will run automatically when calling covio .



travis-ci



The task is described in .travis.yml , there is good documentation for its contents. For our project, it will contain:

 language: python python: - "2.7" services: - mongodb - redis-server before_install: - sudo apt-get update -qq - sudo apt-get install -qq sloccount install: - pip install -r requirements/ci.txt - cp coviolations_web/settings/local_ci.py coviolations_web/settings/local.py - ./manage.py syncdb - ./manage.py migrate script: - covio 


For open projects, the service is provided free of charge, for closed projects - $ 129 + per month .

From the buns service provides:



drone.io



In drone.io, the task must be described on the project page in the service itself. For coviolations, you will need to tick the MongoDB and Redis databases, set the token in the Environment Variables :

 COVIO_TOKEN='17c0f6b3-habr-4d9c-not3-token5af9fe' 


And in the Commands section, describe the task as a simple script:

 sudo apt-get update -qq sudo apt-get install -qq sloccount pip install -r requirements/ci.txt cp coviolations_web/settings/local_ci.py coviolations_web/settings/local.py ./manage.py syncdb ./manage.py migrate covio 


For open projects, the service is free, for closed projects - $ 25 + per month .

Additional amenities include:



Result

travis-cidrone-io
Pull request supportYesNot
DeployableNotYes
Affixing the status of commitsYesNot
Saving artifactsNotYes
Api for third-party servicesYesNot
Price$ 129 + per month$ 25 + per month


')

Source: https://habr.com/ru/post/204900/



All Articles