Prerequisites:
1, there must be two servers, one is the production environment, the other is the test environment.
2. Jenkins must be installed on both servers.
3, wherein, the production environment of Jenkins has opened the permissions of the CLI (Windows reference: http://www.cnblogs.com/EasonJim/p/6086018.html).
Specific implementation steps:
1, in the production environment Jenkins configuration an decompression operation of the project for deployment and a restore project for rollback
Extract:
Command line:
Echo [INFO] Backup compression operation Pager C: \ "program Files" \winrar\rar.exe a-x*\upload*-x*\ueditor*-x*\uploadfolder*%filepath%.bak. rar%unzippath% Echo [INFO] decompression Operation call c \ "program Files" \winrar\rar.exe x-ep2-o+-%filepath%%unzippath%
Description
Backup is done before the decompression, that is, every operation before the backup.
1) When deploying, such as uploading a file name of 1.rar, then the backup file is 1.rar.bak.rar.
Restores:
Command line:
Echo [INFO] Backup compression operation Pager C: \ "program Files" \winrar\rar.exe a-x*\upload*-x*\ueditor*-x*\uploadfolder*%filepath%.restorebak. rar%unzippath% Echo [INFO] decompression Operation call c \ "program Files" \winrar\rar.exe x-ep2-o+-%filepath%%unzippath%
Description
Backup is done before the decompression, that is, every operation before the backup.
1) rollback, such as the file name of the uploaded backup is 1.rar.bak.rar, then the rollback operation backup file is 1.rar.restorebak.rar.
Jenkins uses FTP for one-click Deployment and Rollback (Windows)