A thousand miles kuibu, thousands of rivers. Make a little progress every day, and one day you’ll be a big shot
series
-
Jenkins Tutorial – Building (Docker version)
-
Jenkins Tutorial – Creating Maven projects
-
Jenkins Tutorial -Docker+GitLab Continuous deployment continuous integration
-
Jenkins Tutorial – Integrating SonarQube
preparation
This tutorial is integrated with GitLab, so the GitLab repository is required. Note: Your Jenkins address must be accessible to Gitlab if you want to automate deployment later. If gitLab picks up on the incident, we won’t be able to notify Jenkins;
The environment
- Centos 7
- Jenkins (Docker version)
The required plug-in
In addition to the plugins you installed when building Jenkins, you also need to install plugins
- Maven Integration
Install Maven
Click Manage Jenkins in the sidebar and then Global Tool Configuration to go to Global Tool Settings
Then go to Maven and click Add Maven to select the version of Maven you want and set a name. Click save
Create Git login credentials
Click on the credentials in the sidebar and then click on the image
There are a lot of options for Kind here, so here I’m going to go to Username with password, and I’m going to set it with the account password; Then enter the gitlab account and Password in the Username and Password input boxes, respectively. Click OK to save;
After saving, you will appear to save the credentials;
Create a JOB
Creating a Maven project
Enter your GitLab project address and select the credentials you just configured
Enter the Maven packaging command and click Save
Begin to build
View the build project log
The first build will be slower because he has to download the maven-related build package
View the built JAR package
At this point, you are finished building the Maven project and can download the JAR package for deployment. A tutorial on automatic build deployment will follow