
More recently, the new continuous integration system for open-source PHP projects,
PHPCI (current version 1.1.0), has been released from beta, it was mentioned briefly in
PHP Digest 21 .
I have been experimenting with this system for some time, so I want to give you a small overview of it, especially since there is not a single article about Habré.
')
Now PHPCI is available in two options: rent by subscription, as well as self-hosted installation from source code.
Plugins
The system is written in PHP and for PHP, therefore out of the box it supports an impressive list of tools from the world of PHP through plugins:
It also has several general purpose plugins or those not directly related to PHP tools:
The project is quite modern and requires PHP version 5.3 or higher, uses PDO to connect to databases and in general, in my opinion, has simple and clear source code that uses namespaces for classes and PSR-2 style for code, which is undoubtedly very good .
Plug-ins, as a rule, are quite simple and small in terms of code size, so it’s easy to write your own plugin for a tool that is not supported in the standard package.
Project Configuration
The system has a declarative style for describing project configurations (using the YAML format), which is quite convenient, especially for small projects.
The configuration file phpci.yml is taken from the root of the project repository (or simply the working directory of the project, if we are talking about a local source), it is also possible to configure directly in the PHPCI project when it is created.
Below is a small example of the phpci.yml configuration file:
build_settings: ignore: - "vendor" - "tests" setup: composer: action: "install" test: php_unit: config: - "phpunit.xml" coverage: "logs/tests_coverage" args: "--stderr" php_mess_detector: allow_failures: true php_cpd: allow_failures: true php_loc: allow_failures: true php_parallel_lint: allow_failures: true
The configuration file has several root sections:
build_settings
- project build settings (ignoring directories, database connection settings)setup
- the project build initialization section (installing dependencies, querying databases, migrating for databases)test
- a section for testing the finished build of the project (various plug-ins are launched above the build that return successful or not results; failure usually leads to assembly failure, although this is not the case for individual plug-ins and you can set the number of errors leading to the failure of the entire assembly )complete
- a section called by the system after testing, regardless of its resultsuccess
- the section called by the system after testing only in case of successful assembly and testing of the projectfailure
- a section called by the system after testing only in case of assembly failure or project testing.
Sources
The system supports as a source of projects: Github, Gitlab, Bitbucket, Git, Hg or a local directory. Svn is not supported yet (I'm not sure that its support is in the plans at all).
A spoon of tar
Despite its attractiveness, PHPCI is quite young and does not (yet) know how:
- as I wrote above, he does not know how to work with Svn
- does not know how to deploy on databases other than MySQL (although for operations in the projects there is already a plug-in for PostgreSQL)
- does not know how to work when building with relational databases MSSQL, OracleSQL, SQLite, etc.
- does not know how to fully deploy the project using standard tools (although this can be achieved using the Shell plugin)
- does not know how to work with NoSQL databases
Summary
I personally see the project as very good and necessary, but still a little damp. Using this system for large projects may still be problematic, but on the other hand, PHPCI is great for small home projects right now.
How to install the system can be found
on the page in the official project wiki .