In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
After jenkins note (1) carries on the actual combat java code release, this uses the github private warehouse to pull, the jenkins uses the maven to compile the source code after the speech package releases to the web server.
1. Create a git private repository
You can refer to the remote warehouse building section in GIT's notes, where the java source code uses zrlog, pull the source code to github, and configure the jenkins public key to github to get the next wave.
II. Web server tomcat configuration
The manager page of tomcat needs to be configured on the web server where the code needs to be published.
Yum install java-1.8.0-openjdk.x86_64-y & &\ wget-c-O / usr/local/apache-tomcat-9.0.2.tar.gz & &\ http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.2/bin/apache-tomcat-9.0.2.tar.gz & &\ cd / usr/local/ & & tar-xf apache-tomcat-9.0.2.tar.gz & &
At this point, tomcat has been successfully installed, and you need to configure the manager page.
You need to add the following to / usr/local/tomcat/conf/tomcat-users.xml.
After the modification is as shown in the figure above, add the role role permission of manager. Next, you need to modify the source control access of the manger page, and add the ip of jenkins to the whitelist.
Modify / usr/local/tomcat/webapps/manager/META-INF/context.xml
The default manager page of tomcat only allows local and ipv6 addresses. Here the ip of my jenkins server is: 172.20.6.0Comp24, which can be determined according to the actual situation. Network segment is supported. Do not open all 0.0.0.0 in case of * *.
Tomcat/usr/local/tomcat/bin/startup.sh needs to be started after configuration is completed.
At this point, we can test the tomcatmanager interface of the web server, http://IP:8080/manager/index.html
Fill in the user name in the configuration file: admin, password: kaliarch
Third, create a release project
To release java, you need to install two plug-ins, Maven Integration plugin and Deploy to container Plugin. If not, you need to install these two plug-ins. After installing the plug-in, you need to restart jenkins.
3.1 create a new item
Enter the project name, choose to build a maven project, and confirm.
3.2 configure source code management
Select git for source code management and enter url in the warehouse.
An error message will appear at this time, because this warehouse is my private warehouse, and you need to configure Credentials, click add, and the Kind of Add Credentials selects the user name of the public key user previously uploaded in github. This time, root,Private Key logs in to the local private key of github for the jenkins server. Check the private key cat / root/.ssh/id_rsa and copy and paste it into the Key area to complete the addition. At this point, it can be found that the error report has disappeared.
3.3 configuration Publishing to web Server
Add add post-build operation, select Deploy war/ear to a container,WAR/EAR files and fill in * * / * .war. Containers choose to add container and add tomcat 8.x department credentials point add. The user name and password entered here is the user name and password of tomcat's manager page, and here is admin/kaliarch.
Tomcaturl enter the tomcaturl of the web server
3.4 configure Mail message Notification
Add add post-build actions, select Editable Email Notification, and use plug-in email to send notifications.
You can customize the subject and content of the email according to your needs. Add the recipient here. Because always is configured globally, fill in the recipient mailbox in the advanced settings.
3.5 Information View
Click Save and build immediately to view the log information.
Log in to the web server and see that the war package has been released.
Open the web page to test.
View email notifications.
At this point, the java program has been released, and then the code can be modified and submitted to github, and then automatically released through jenkins.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.