Adding A CI/CD process to my work flow is one of the really quick wins I do on every serious project I work on.
Whilst most of my personal work is hosted on Gitlab, a recent project I was working had its code in Bitbucket. This was my first time working with Bitbucket, so I wanted to document how I built assets, linted and ran tests using its pipelines.
What will these pipelines do?
By the end of this article you should have a working bitbucket-pipelines.yml
file for your Laravel project which will do the following:
- Use
composer
to install your projects dependencies - Run
php-cs-fixer
to enforce a code style - Run
larastan
to run static analysis against the code base - Run
php-cs-fixer
andlarastan
in parallel - Run
phpunit
to run our projects test suite - For a production build
yarn run production
- Allow us to manually trigger a deployment to production using Laravel Deployer.