Detailed explanation of the Docker deployment tutorial for Jenkins beginners

Detailed explanation of the Docker deployment tutorial for Jenkins beginners

This article deploys Jenkins+Maven+SVN+Tomcat through docker, installs Maven and its own OpenJDK on the base image Jenkins to form a new image, then checks out the project through SVN, and uses Jenkins' own plug-in or script to send the war package generated by Maven to the specified Tomcat's WebApps directory, and finally starts Tomcat to complete the automated deployment.

Through the docker command: sudo docker run –d -p 9898:8080 -p 50000:50000 -v /alidata/projects/jenkins:/var/jenkins_home -u 0 jenkins exposes the port and mounts the container directory (to facilitate modification of the container)

The Jenkins installation will prompt you to enter a password. This password will appear when Jenkins is started for the first time. You can copy and enter it. The rest of the default installation is not explained here. The following is an introduction to the use of Jenkins:

For the first time use, you can click System Management à Click System Settings to make global settings. This is only set when global settings are needed. You can choose not to set it. In this way, when creating a project, you can make corresponding settings for each project. If you do not set it when creating a project, the setting mode in the system settings will be used.

Regarding Global Tool Configuration, you can configure it according to the tool directory. If it is not available, Jenkins can automatically download it during the build.

The Configure Global Security option is for permission management. You can set up automatic registration permissions to allow users to automatically register and perform project operations (operation service permissions have been enabled).

Read settings: Abandon all the current settings in the memory and re-read from the configuration file. This is only used to re-read settings when you manually modify the configuration file.

Manage plugins: Add, remove, disable or enable plugins to extend Jenkins functionality. The required plug-ins can be downloaded here. Currently, Jenkins provides a large number of plug-ins, which can basically meet the project requirements. If the plug-in download fails, you can download it from the official website:

Official website plugin download address https://wiki.jenkins-ci.org/display/JENKINS/Plugins

After downloading is complete, click Advanced and upload the plug-in:

After the installation is complete, refresh the Jenkins WEB interface.

Let’s create a new project and see:

Our projects are all Maven projects, so select the Maven option, fill in the name of the project to be built, and confirm.

Description: Fill in the description of the created project.

GitHub project: The URL of the project hosted on GitHub.

Throttle builds: Set the number and rate of builds within a specified time.

Discard old builds: commonly used to avoid building more and more projects and occupying memory.

In the source code management section, select SVN, fill in the URL and user password, and the project will be automatically checked out when it is built. In the Check-out Strategy section, select the SVN code update method. Readers can make changes according to their personal needs.

Build triggers:

This article mainly introduces the use of Build periodically and Poll SCM. Both of them are time schedules for periodically triggering builds. However, the function of Build periodically is that the project must be rebuilt when the set time is reached, but with Poll SCM, the build will only be performed if there is an update on SVN at the set time, otherwise it will not be built.

The format of the set build time rule can be seen on the right? Help, detailed introduction.

This is the Maven packaging command

The build settings can send email notifications, and reports can be sent every time a build is completed.

Please note that after the build, you need to enable the tomcat-users.xml permission in Tomcat

This article is for beginners of Jenkins. Students who don't know Docker can change the startup steps to their own startup methods. The rest are the same. This article uses the software that comes with Jenkins for deployment. The advanced article will deploy through shell scripts edited by yourself. After all, they are all written by yourself and are easier to control.

This is the end of this article about the tutorial for beginners on how to deploy Jenkins with docker. For more information about deploying Jenkins with docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to use DockerFile to automatically deploy Java projects in Jenkins
  • Detailed tutorial on deploying Jenkins based on docker
  • Automatically build and deploy using Docker+Jenkins
  • Introduction to Jenkins and how to deploy Jenkins with Docker
  • Docker container uses Jenkins to deploy web projects (summary)

<<:  mysql implements importing only a specified table from the sql file of exported data

>>:  Example code for element multiple tables to achieve synchronous scrolling

Recommend

Xhtml special characters collection

nbsp &#160; no-break space = non-breaking spa...

HTML tag dl dt dd usage instructions

Basic structure: Copy code The code is as follows:...

How to redirect URL using nginx rewrite

I often need to change nginx configuration at wor...

Basic usage knowledge points of mini programs (very comprehensive, recommended!)

Table of contents What to do when registering an ...

Quickly solve the Chinese input method problem under Linux

Background: I'm working on asset reporting re...

How to install Oracle on Windows Server 2016

1. Install Oracle There are too many Oracle insta...

Vue custom encapsulated button component

The custom encapsulation code of the vue button c...

Explore JavaScript prototype data sharing and method sharing implementation

Data Sharing What kind of data needs to be writte...

Detailed explanation of MySQL InnoDB secondary index sorting example

Sorting Problem I recently read "45 Lectures...

How to implement Mysql scheduled tasks under Linux

Assumption: The stored procedure is executed ever...

Solve the problem of docker container exiting immediately after starting

Recently I was looking at how Docker allows conta...

Detailed explanation of the cache implementation principle of Vue computed

Table of contents Initialize computed Dependency ...

Summary of CSS gradient effects (linear-gradient and radial-gradient)

Linear-gradient background-image: linear-gradient...