Image source: https://qautomation.blog/2019/05/28/jenkins-pipeline/

This post will show you how to configure a Jenkins pipeline that will automatically build your project when you push code to a GitLab repository. We will be using a Jenkinsfile to define our pipeline, which is best practice.

Here’s the workflow:

Push to GitLab → Jenkins pipeline triggered → Run build (Maven) → Run JUnit tests (Maven) → Email result from pipeline

If you don’t already have GitLab and Jenkins installed, you can follow the instructions in this post and then come back here.

This post also assumes you have Java, Git, and Maven installed, along with a simple…


If you’re new to DevOps or CI/CD and want to get started using the tools without having to configure multiple servers or networks, then installing GitLab and Jenkins on the same machine can expedite your configuration and allow you to focus on learning the tools themselves.

Disclaimer: This type of configuration is not recommended for production, but is meant to serve as a first step in learning how to implement CI/CD.

By the end of this post, you will have GitLab and Jenkins installed on the same CentOS 7 server, with GitLab listening on the default HTTP port (80) and…

Grant Foster

Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store