Jenkins+svn automated deployment of dubbo service

Preface

Since they are all newly-built dubbo projects, they have not yet been launched and are still in the intranet testing stage, so I have not used tools to package them. All are manually packaged and updated. If multiple services are updated, it is a very cumbersome process. First, package the service of the interface exposure layer and package the service of the startup layer. Then the server is replaced by various jar packages and restarted. No way, this can only do the operation and maintenance work by yourself.

Install Jenkins

Official website address: http://pkg.jenkins-ci.org/redhat-stable/

Installation command: rmp -ivh jenkins-2.222.1-1.1.noarch.rpm

To modify the port: vi /etc/sysconfig/jenkins, find Jenkins-port and modify it

Modify the java configuration: vi /etc/init.d/jenkins to your own java path

Install jdk environment

Install maven

Start service jenkins start/stop/restart

Install plugin

1. Install the svn plugin: Subversion Plugin

2. Because you need to pull code from multiple warehouses, you must also install this plugin: Multiple SCMs

Pit

1. When I first installed the plug-in, I kept reporting connect time out, but the installation was not successful. Later, I found the reason through Baidu.

Jenkins will check the network connection before downloading the plug-in. It will read the URL in the file default.json (/var/lib/jenkins/updates/default.json). The default is to access Google. This is a pitfall. Server network If you can't get over the wall, the test must have failed. Just replace the google in the picture below with baidu.

2. Modify the plug-in download address: https://updates.jenkins.io/update-center.json to the address provided by Tsinghua Park: https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update -center.json . The location of the file: /var/lib/jenkins/hudson.model.UpdateCenter.xml.

3. To set up multiple warehouses, you must specify the save path, generally it will be saved under /var/lib/jenkins/workspace, if server is specified, it will be saved under /var/lib/jenkins/workspace/server. If you don’t specify what the consequences will be, the code of the second warehouse will overwrite the code of the first warehouse. At first, I didn’t understand why I clearly specified that the code of the first warehouse was packaged. The code is packaged in the second warehouse all the time.

4. Due to the need to write scripts for release and deployment, I also added an Xshell script by the way.

(1) Execute the script and find that there is no rm, mv and other permissions.

      Add sudo before the Xshell command

(2) After adding sudo, I found: command not foud

To be continued...

     

 

 

 

 

 

Guess you like

Origin blog.csdn.net/weixin_39886135/article/details/106856566