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

SitePoint PHP Blog:
Re-Introducing Jenkins: Automated Testing with Pipelines
Jan 06, 2017 @ 16:48:44

The SitePoint PHP blog has posted a tutorial from Alex Bilbie that "re-introduces you to Jenkins", a popular build automation software, and how you can integrate it, and a new feature called "pipelines", into your processes.

As our applications become more complex – with Composer dependencies, Webpack build scripts, and per-environment variables – we inevitably reach a point where testing all of these different intricacies becomes slow and laborious, especially when you’re tearing down and rebuilding the entire environment for each test. Likewise, code style might deviate over time and creating a production ready deployment archive requires a specific set of steps to be followed.

He talks about some common tasks that might be involved in the build (installing Composer libs, running PHPUnit, etc) and how automating them can help prevent issues and make it less time consuming for your developers as they make changes. Along with the latest version of Jenkins (v2.0) they introduced the "pipelines plugin". Pipelines allow you to define multi-step configurations Jenkins then uses when the build is executed. He walks you through installing Jenkins, setting it up and creating your first job. They provide the example pipeline script to get you started. There's also a section talking about the Jenkinsfile and setting it up in the Jenkins job to automatically be used (instead of a config in-job).

He finishes the post looking at multibranch pipelines and some things "taking it further" by adding in other plugins, customized with their own section in the Jenkinsfile configuration.

tagged: jenkins pipelines automation testing pipelines plugin groovy

Link: https://www.sitepoint.com/re-introducing-jenkins-automated-testing-with-pipelines/


Trending Topics: