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

Detailed steps for installing MinIO on Docker

Table of contents 1. Check whether the docker env...

Getting Started Tutorial for Beginners⑧: Easily Create an Article Site

In my last post I talked about how to make a web p...

MySQL column to row conversion, method of merging fields (must read)

Data Sheet: Column to row: using max(case when th...

MySQL 8.0.24 version installation and configuration method graphic tutorial

This article records the installation and configu...

Learn MySQL execution plan

Table of contents 1. Introduction to the Implemen...

How to deploy hbase using docker

Standalone hbase, let’s talk about it first. Inst...

A commonplace technique for implementing triangles using CSS (multiple methods)

In some interview experiences, you can often see ...

Simple CSS text animation effect

Achieve results Implementation Code html <div ...

How to use SessionStorage and LocalStorage in Javascript

Table of contents Preface Introduction to Session...

Detailed explanation of the usage of MySQL data type DECIMAL

MySQL DECIMAL data type is used to store exact nu...

Steps for Django to connect to local MySQL database (pycharm)

Step 1: Change DATABASES in setting.py # Configur...

Detailed explanation of redundant and duplicate indexes in MySQL

MySQL allows you to create multiple indexes on th...

Basic operation tutorial of files and permissions in centos

Preface Before we begin, we should briefly unders...

Detailed explanation of MySql 5.7.17 free installation configuration tutorial

1. Download the mysql-5.7.17-winx64.zip installat...