1, background
Learning about Jenkins as a continuous integration tool because it is necessary and interesting, simply speaking, Jenkins is a widely used Visual Web tool for continuous building, and continuous building is the automation of various projects "packaged, packaged, on-line deployment." Jenkins is very supportive of this. , Jenkins itself is Java-developed, but he is well-supported in various languages (java,python,php, etc.), supports many third-party plugins, and integrates seamlessly with git and svn.
2, installation
Jenkins supports various distributions of Linux, and Ubuntu (16.04) supports both war packages and Deb, and Jenkins's official address https://jenkins.io/ Index.html, we chose Ubuntu/debian after we went in.
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/89/47/wKioL1gOzabA8-3nAABeKi9vyOw599.png-wh_500x0-wm_3 -wmp_4-s_2323721889.png "title=" capture. PNG "alt=" Wkiol1gozaba8-3naabeki9vyow599.png-wh_50 "/>
Here Deb Https://pkg.jenkins.io/debian-stable binary/here is the HTTP protocol, not the HTTPS protocol, this remember, otherwise it is a failure. There is a picture of the truth, this is what chrome caught, we can see the HTTP protocol is going
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/89/47/wKioL1gOzr2RYpRcAAAgM7o3mNY665.png-wh_500x0-wm_3 -wmp_4-s_3985141379.png "title=" Capture 1. PNG "alt=" Wkiol1gozr2ryprcaaagm7o3mny665.png-wh_50 "/>
3, after the start of Apt-get install Jenkins, this time the system will automatically resolve the dependency, because Jenkins is the Java language, it will certainly rely on the installation of JDK, but Jenkins installed, the system itself to solve the dependency is OPENJDK, At that time also did not care too, as for openjdk and Sun's JDK have what but not, this is not discussed in this article, and I do not do Java background development, this if interested can Google or Baidu.
4, after the installation is complete, we can start the Jenkins service,/etc/init.d/jenkins start, using NETSTAT-TUNLP we can see that he is listening on the 8080 port, using the browser to access http://IP:8080. Will jump to our login interface, and then follow the prompts step by stage installation, install plug-ins, those are the default need to install, this process some plug-ins we may not install, this is to thank us for "great" Professor Fang Binxing, his firewall does not say much, we log in to enter the System management interface , click Go to the Admin plugin, select Advanced, choose the address of our proxy server to install the unsuccessful plugin, or dial the VPN installation plugin directly.
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/89/4A/wKiom1gO0ruzEFAFAAEBv2f7e5w861.png-wh_500x0-wm_3 -wmp_4-s_1808216493.png "title=" Capture 2. PNG "alt=" Wkiom1go0ruzefafaaebv2f7e5w861.png-wh_50 "/>
3, the problem left behind
My own still do not solve, like pipline,git such an HPI file (plug-in) is still not installed, no matter what method, no way, I guess it may be the use of OPENJDK caused it, let's think so. There is no way to change the way to install it.
This time I downloaded the Deb package directly and then installed the JDK Config Java environment variable, my Deb package was downloaded on Windows, then copied to Linux, installed using the Dpkg-i command, but the error displayed
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/89/48/wKioL1gO13bRaNuIAADlrNPEVts077.png-wh_500x0-wm_3 -wmp_4-s_3751837677.png "title=" Capture 3. PNG "alt=" Wkiol1go13branuiaadlrnpevts077.png-wh_50 "/>
Baidu, said is this is the package is not complete caused by their own look at the size found the same ah, how may not be complete, so in Windows and Linux made a MD5 check, the results found really different, the first big pit. Then re-download the full package, the installation also prompted me to rely on OPENJDK, this I have no way, do not use this method.
Because Jenkins this official offers not only deb This package and war this package, Deb's not, we try to install the war package, the first war package installed us, we go to the JDK's official website to download the installation, download the completion of the corresponding directory, remember to do the environment variable configuration.
1,war Package Installation We can use the command Java-jar Jenkins.war this way, this I have not tried, do not know if there will be any problem
2, the use of Tomcat to run our war package, this simple and convenient more, install Tomcat not much to say, a grab a lot of online, and then put Jenkins.war into the Tomcat WebApps directory inside
Then started Tomcat, this visit http://IP:8080/jenkins, into the installation of Jenkins page, installation step by step installation, to install plug-in that step will still prompt a lot of plug-in installation, this aspect and their Internet connection, On the other hand is our firewall, and finally landed into the system management interface, and the beginning of the same, the use of proxy or dial VPN to install, you can download which HPI files themselves, upload, but this has drawbacks, this many plug-ins exist between dependencies, Uploading plugins yourself won't solve the dependency problem. Multiple retest several times, each time the installation succeeds or fails, restart Jenkins, and then plug-in whether the plugin is not installed, until the required plug-in installation success
Ubuntu install Jenkins on the pits encountered