Last year, I introduced the NAS system of Qunhui in the public account (Qunhui NAS – your private cloud). This time, WE will install Jenkins through the Docker kit of Qunhui. This may be the first article in the whole website that introduces how to install Jenkins under the new system of Qunhui.
Install Jenkins
In order to ensure the stability of access in China, my blog is deployed on Coding, which results in continuous integration (CI) being unavailable all the time. If there is no CI, three more lines of code will be needed for each deployment. Laziness is the primary productivity, so, Tried to install Jenkins at Qunhui NAS today.
Jenkins is an open source continuous integration tool written in Java. Jenkins provides continuous integration services for software development. It runs in a Servlet container (such as Apache Tomcat). It supports software configuration management (SCM) tools (including AccuRev SCM, CVS, Subversion, Git, Perforce, Clearcase, and RTC) to execute projects based on Apache Ant and Apache Maven, As well as arbitrary Shell scripts and Windows batch commands. Jenkins’ main developer is Kosuke Kawaguchi. Jenkins is free software distributed under an MIT license.
Continuous integration is simply the “automated” compilation, packaging, distribution and deployment of projects, which greatly improves the degree of project automation. Without further ado, let’s look at how to install.
Open the Docker suite in the glow, click on the registry, there are many uploaded images in the registry download:
The registry
Double-click the image of Jenkins and select the Jenkins version. Here select the latest version:
Once the download is complete, you can see it in the image:
After selecting Jenkins, click the start button at the top to enter the setting page:
Here, the container name can be named as you like, other Settings can be unchanged, directly enter advanced Settings:
In advanced Settings select the shortcut to Web and write 8080 after the port number so that you can jump to Jenkins by clicking directly on the desktop.
Click port Settings and change port 8080 to the following:
After the modification is complete, click Apply and you can see Jenkins is already running in the container:
Here’s the Jenkins shortcut we clicked on the desktop to pop up on this page:
At this point we need to get the generated administrator password. Or go back to the Docker suite, click the details button in the container to enter the details interface, select the terminal TAB, and directly click the new button to pop out the bash page:
Then enter the following command (cat followed by the address shown in red on Jenkins’ page) :
cat /var/jenkins_home/secrets/initialAdminPasswordCopy the code
Click “Continue” to enter the plugin installation page. You can choose to install the default plugin according to your personal preference or choose your own option:
After clicking Install button in the interface selected by yourself, there will be a deadlock phenomenon. At this time, close the page and re-enter, you can see the installation interface:
After the installation is complete, you can create accounts:
Once the account is created, you can enter Jenkins’ familiar (and still ugly) screen:
Build Coding projects using Jenkins
In this section, coding has already been written for me, and it is very detailed. You can check the coding document for details, so I will not bother to write any more.
The only caveat is that the first requirement for building a Coding project using Jenkins is that your Jenkins address be accessible from the Internet. Usually, we access the NAS of qunhui through the Intranet address, but cannot access the Internet. If we need to access the Internet, we can use the following methods:
- Use Qunhui’s own QuickConnect service (slower in China, because the server is in Taiwan)
- Use tools such as NGROk and peanut shell to penetrate the Intranet
- Purchase VPS such as Aliyun and Tencent Cloud to obtain public IP addresses and map the Intranet to public IP addresses
- Call the carrier, get the public IP, and map the Intranet (it depends on whether the carrier gives it, but there are many successful cases online)