When building in Jenkins, you may need to ssh into a remote server to execute the necessary scripts before you perform the build. At this point, you need to install SSH Plugin and configure the following.
1. Install SSH Plugin in the Jenkins interface, System management, management plug-ins
Description, the purpose of SSH plugin is to support SSH to the remote server, and then execute the shell command.
2. In the Jenkins interface, the System Management->configure (config)->ssh remote hosts
Configure the server information for the remote connection to SSH, as shown in the following example: Hostname:ssh server address port:22 user name: Login username password/passphrase: login password
3. In the Jenkins interface, configure a job-> in the "Build environment" area tick execute shell script on remote host using SSH and make the following necessary settings:
SSH site: Select the SSH Pre build script set in step 2: scripts to be executed before building, such as./pre_test.sh Post Build script: Scripts to be executed after build, such as export paht=/root