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:

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.

This should mean that eventually the sum of these 2 blog posts (Config and Deploying) could be replaced with a single package and artisan command.

In order to make the yaml generation easier this package requires the php-yaml extension. Which is installable as follows:

// ubuntu
sudo apt install php-yaml

// others
pecl install yaml

Currently 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.