Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Oh Dear Blog:
Our Gitlab CI pipeline for Laravel applications
Dec 18, 2018 @ 17:14:53

On the "Oh Dear!" blog they've written up a post sharing the Gitlab continuous integration pipeline they use for the deployment of the application. While, in their case, it's a Laravel-based application, the basics of it could be used for just about any PHP application with slight modifications.

We've been fairly public about the amount of testing we have for Oh Dear!. Freek has been showing bits and pieces on his Twitter to show the extent of that effort.

Having a huge test suite is nice, but integrating it into your development workflow is even better.

That's why we're releasing our Gitlab CI pipeline that is optimized for Laravel applications. It contains all the elements you'd expect: building (composer, yarn & webpack), database seeding, PHPUnit & copy/paste (mess) detectors & some basic security auditing of our 3rd party dependencies.

The post starts with an overview of their pipeline flow (including a graphic) showing the different stages and the steps involved in each. It then moves on to the setup of Gitlab's CI functionality using a local Gitlab runner to run the pipeline. It covers some of the issues around CPU load using Docker. Next it shares the configurations for the different stages in the flow and decisions they had to make around building assets, dependencies and caching.

tagged: tutorial laravel application gitlab gitlabci continuous integration setup pipeline

Link: https://ohdear.app/blog/our-gitlab-ci-pipeline-for-laravel-applications

Pineco.de:
Hosting Private Laravel Packages on GitLab
Dec 19, 2017 @ 18:58:27

On the Pine site they've posted a quick tutorial showing how to host private packages on Gitlab, in their case it's for Laravel-related packages but it would work with any project making use of Composer for package management.

When we want to restrict the access to the package we made but we don’t want to pay for a service like Private Packagist, we can use tagged: hosting gitlab private package accesstoken tutorial composer configuration

Link: https://pineco.de/hosting-private-laravel-packages-gitlab/

Stephan Hochdöfer:
Dockerizing GitLab Review Apps
Jun 07, 2017 @ 15:28:15

On the BitExpert blog Stephan Hochdöfer has written up a post showing how to "Dockerize" GitLab review apps to create a consistent platform for these self-contained environments.

Last year GitLab introduced the Review Apps feature. Review Apps are app environments that are created dynamically every time you push a new branch up to GitLab. As a bonus point the app environments are automatically deleted when the branch is deleted. Since we moved to using docker for quite a few of our projects I was keen on figuring out how to combine Docker and the GitLab Review Apps functionality as the documentation only mentions NGINX as a way to run Review Apps. As it turns out, it is rather simple to deploy docker containers as a Review App.

He describes the environment he needs and which tools he'll be using to perform the build of the environments. He then defines the sample GitLab configuration file including the "build" stage. He briefly explains the steps this follows then shows the configuration for the "deploy" step, grabbing the latest image from his Docker repo and running it. He ends the post with an "undeploy" stage that removes the Docker build automatically when the environment is no longer needed.

tagged: gitlab review application apps tutorial docker deploy undeploy

Link: https://blog.bitexpert.de/blog/dockerizing-gitlab-review-apps/


Trending Topics: