Upload the build products on the Jenkins job to the remote FTP server

1. Copy command:

copy vickytesting.png ip\pictures

This does not work, it can only be copied in different places on the local computer. Even if the target directory you write is a remote IP address, it will generate a folder with the corresponding IP name for you, which is maddening:

2. xcopy command:

net use //ip/ipc$ " " /user:" " establishes an IPC empty link 
net use //ip/ipc$ "password" /user:"username" establishes an IPC non-empty link 
net use h: //ip/ c$ "password" /user:"username" After logging in directly, map the other party C: to the local as H: 
net use h: //ip/c$ After logging in, map the other party C: to the local as H: 
net use //ip /ipc$ /del delete IPC link 

This is also useless. . .

3. Publish Over FTP Plugin:

Perfect solution, but you need to install this plugin on Jenkins first:

 

Search for and select the "Publish Over FTP" plugin in the available panel, then click "Install without restarting":

Waiting to install:

After the installation is successful, click to return to the home page:

Of course, at this point you can see this FTP plugin in the plugin management->installed list:

 

4. Using the FTP plugin:

Enter the configuration interface of a Job, and select the option to add build steps after the build - "Transfer files via FTP:

Here the name of the FTP Server is a drop-down box:

After clicking the question mark, there is a prompt message, let us first go to Jenkins to configure the FTP information, and then select it directly here:

(Because this job of mine is deployed on one of the nodes of the Jenkins server, and I also have the management rights of the Jenkins server, the subsequent configuration steps can be completed by myself. If you do not have administrator rights, you can only ask the administrator for requirements. Let others do the configuration settings later.)

5. Configure FTP on Jenkins Server:

Jenkins -> Manage Jenkins -> Configure System :

Find "Publish over FTP", and configure the basic information:

Click Test after configuring Name, Hostname (IP), Username and Password:

Even if I enter the username and password here, I still get an error.

It was finally found that it was because of a cross-domain problem (firewall problem): the Jenkins Job running machine was not in the same domain as the FTP server. . .

If yours can be connected successfully, you can use it directly.

Finally, a message similar to this will be output in the console to indicate that the file was uploaded successfully:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325157944&siteId=291194637