Automated deployment of remote shell scripts

For historical reasons, there is a period of time, using a model project development: project development and code version management outside the network, including the network and the main test. So in order to synchronize the development progress, every day will all services extranet jenkins packed, and then copy the service pack jar into the network, because the network service using a distributed deployment, different services are distributed on different servers, so the need to manually each service pack placed on each server, and execute the startup script to start for network testing. This work must be repeated every day, and publish the entire service takes a long time, jenkins automated deployment, including network and is not feasible, and therefore choose to automate publishing service by executing the script.

The following script demonstrates the presentation by a remote login server -> Backup service pack to be replaced -> copy the corresponding directory service pack to the appropriate server -> Publish entire process services.

1. Define constant variable

2. remote login method

3. Back up the last service pack method

4. Upload method

The deployment method

6. Service Pack judge

7. contracting process control

 

The above script to automate the deployment of different service packages on both servers, more service packs accumulate in the list, and adds logic to determine, readers can also expand write batch script to stop taking according to the script, batch scripts from clothes, automatically roll back a version of the script and so on.

Guess you like

Origin www.cnblogs.com/zjfjava/p/11286256.html