At our company setting up gitlab ci configuration is one of the jobs I end up doing by default.
This weekend I wrote a package to help speed that process up by generating a .gitlab-ci.yml file as well as installing some of the packages and configuration files to make the following possible:
- Setting an edbizarro docker image based on your target php version
- Lint php files using the laravel shift rules for PHP-Code-Fixer
- Perform static analysis with Larastan
- Run phpunit tests
The package currently provides a single artisan command to do all of the above after answering a few simple questions.
Check the repo out here:
Currently the package doesn’t build anything for automatically deploying code but in time I hope to add this in using Laravel Deployer.
In order to make the yaml generation easier this package requires the
php-yaml extension. Which is installable as follows:
php-yaml is installed in the CI process but I think I should be able to drop that requirement since we’re not going to be generating yaml files in our pipelines.
Hopefully this should help speed things up for people setting up new projects.