Introduction
My most read articles on this blog are about Gitlab CI/CD with PHP. They cover a basic linting, testing and crude deploying process.
Today I want to look at my current CI/CD process for my Laravel projects in more depth. Currently the pipelines of my projects might vary slightly but is very similar to this:
So there are 5 main stages in the process:
- Preparation - The pulling down of dependencies and storing them in an artifact
- Syntax - Check code syntax
- Testing - Run unit tests
- Building - Build assets
- Deployment - Deploying to an appropriate server
The stages are processed in order with each stage containing one or many tasks. Should one task fails in a stage then the whole pipeline stops and is marked as failed.
To run the pipelines I make use of gitlabs free tier which gives you access to 2000 shared minutes per month as well as a runner on a server I have. More about setting that up can be found here.
Continue reading