Maybe many small partners know that in the early days of general interconnected enterprises, most of them use manual packaging to upload and publish code. The common way is to use packaging tools to manually package, upload to WEB server, backup the original code files, publish new code, restart service and check whether the release is successful.
With the passage of time, the number of WEB clusters is increasing. This manual operation will greatly reduce production efficiency. Therefore, a kind of “continuous integration” has been implemented. As for what is “continuous integration”, please Baidu or Google.
Today, Migrant Worker Brother tells you about a small part of “continuous integration”: the function of automatic packaging and code release, which is also commonly used in production environment.
Install JDK, Tomcat environment
Install jdk, Tomcat environment
[[email protected]centos6 ~]# tar zxf jdk-8u111-linux-x64.tar.gz -C /usr/local/ [[email protected] ~]# tar zxf apache-tomcat-8.5.9.tar.gz -C /usr/local/ [[email protected] local]# export JAVA_HOME=/usr/local/jdk1.8.0_111 [[email protected] local]# export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar [[email protected] local]# export PATH=$JAVA_HOME/bin:$PATH [[email protected] local]# export CATALINA_HOME=/usr/local/apache-tomcat-8.5.9 [[email protected] local]# source /etc/profile [[email protected] local]# java -version java version "1.8.0_111" Java(TM) SE Runtime Environment (build 1.8.0_111-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
Install and configure Jenkins
Download Installation Pack on Official Website
[[email protected] ~]# wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war [[email protected] ~]#cp jenkins.war /usr/local/apache-tomcat-8.5.9/webapps/ [[email protected] webapps]#../bin/startup.sh &
Login WEB interface for configuration
Prompt for password
You can find the initial password in the following file
[[email protected] webapps]# cat /root/.jenkins/secrets/initialAdminPassword 0d647a32992149b3b43f77e4bda93809
Enter your password and jump to the next interface
Then choose to install the plug-in, the next step is OK.
installation is complete
Creating Users and Passwords
After completion, you can go to the home page interface to configure and manage it.
Next install the following plug-ins
Install Maven plug-ins through system management-management plug-ins
Because uploading pictures often fails and there are many pictures in installation steps, you can access the following address if you need to see the full text: