"Internet Architecture 'software infrastructure - electricity supplier system architecture (at) -4

Section made from the association and nexus3 jenkins PW, by a github open source maven build from completion of the packaging process, PW and uploaded to a private warehouse. 192.168.72.104 completed tomcat simply download and run. The main automation integration to complete the download j private warehouse shell from nexus3 war by the way, is deployed to the tomcat. jenkins + nexus3 + gogs + tomcat build this environment really is too much trouble, but it is not difficult to understand, or have been built after it can benefit. Key still need to practice. Source:

Continuous deployment (a) tomcat settings

  • Ready to work

Before I demonstrated with the springboot open source project, deployment, this time just to find an open source project on github generation war package for deployment. There are two places need to be modified.

1. Replace the address (used by the actual development gogs above)

https://github.com/Zoutao6/examination_system-.git

2.nexus get uploaded war packet address (192.168.73.103)

 

http://192.168.72.103:8081/service/rest/repository/browse/3rd_part/com/test/example/1.0.0/

http://192.168.72.103:8081/repository/3rd_part/com/test/example/1.0.0/example-1.0.0.war

2. shell change (192.168.73.102) Construction of the

# Dpackaging 修改成 war
# Dfile 修改成上面获取到的/root/.jenkins/workspace/abc-test2/target/Examination_System.war

  mvn deploy:deploy-file -DgroupId=com.test -DartifactId=example -Dversion=1.0.0 -Dpackaging=war -Dfile=/root/.jenkins/workspace/abc-test2/target/Examination_System.war -Durl=http://192.168.72.103:8081/repository/3rd_part/ -DrepositoryId=nexus

3. Write original apche-tomcat making soft connection (192.168.73.104)

cd ~
ln -s jdk1.8.0_141/ jdk
ln -s apache-tomcat-7.0.94/ tomcat

4. Create a services folder into the script

#创建service群,里面可以放很多个tomcat
mkdir services
cd services
#文件上传插件
yum -y install lrzsz
cp -r /root/tomcat/ /root/services/shop-project/
cd /root/services/shop-project/
rm -rf apache-tomcat-7.0.92/ bin BUILDING.txt  CONTRIBUTING.md  LICENSE  NOTICE  README.md  RELEASE-NOTES RUNNING.txt 
# env-set.sh上传bin目录跟shop-project 同级
cd /root/service/bin
rz 
# deploy.sh jenkins.sh pom.sh  tomcat.sh
# 上传到shop-project目录内

4. Operation Command

#查看目录文件
ll
#这个文件夹的名称目前是shop-project,可以自行修改
cd shop-project
#针对解压后的脚本增加访问的权限
chmod -R 777 *
cd ..
cd bin
chmod -R 777 *

image.png

5. Download war, to start the project from the nexus PW

./jenkins.sh

6. Close this project tomcat

./tomcat.sh stop

7.app-conf

The main catalog for in different local and server environments password, after each download, replacing the inside of the profile, if every developed modified the configuration file, the server environment also need to modify the corresponding.

8.shop-project

Just a folder name, you can modify according to their needs.

(B) summary

Three related articles complete.
1.gogs deployment, jenkins deployment, nexus deployment.
2.jenkins associated with previous nexus, by connecting github download the source code, and then talk to package source code uploaded to the designated warehouse nexus of.
3.tomcat by way of a shell script to download nexus in the war package. Alternative app-conf replace the server's configuration files, shell piece of my comments, you can choose for use.
4.pom.sh is mainly based on the way to download the configuration.
5. shop-project newly created file folder rely on a tomcat and jdk, so the use, if the tomcat and jdk replacement, just delete the newly created soft soft link connection on it.
6. The plurality of items may be repeated a shop-project folder, the folder to modify the interior of the tomcat conf file modify the port numbers inside pom.sh modified file.
7. This deployment is easy, once and for all. It is said that some of the projects are the only product of this.

PS: electric business system integrated environment completely set up is completed, they gradually build from the deployment of virtual machines, a service of the association before the service takes three days, finally completed, the next step we continue electricity supplier system Learn.



Author: IT human story
link: https: //www.jianshu.com/p/7e3563053b33
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.

Guess you like

Origin blog.csdn.net/qq_28505809/article/details/95317844