Jenkins will cleanup workspaces of jobs for some (unknown) reasons. So we have to save them to some other place as product publish repository. ArtifactDeployer plugin is perfect for this purpose.
Installation
Jenkins -> Manage Jenkins -> Manage Plugins -> Available, check "Jenkins Artifact Deployer Plug-in", then click "Install without restart". If the Jenkins server can't access internet, you can use http proxy to achieve install online;
Usage
-
In the "Configure" page of job GCP-6.20, add a post-build action "[ArtifactDeployer] Deploy artifacts from workspace to remote directories". Enter "*/build/.zip" in "Files to deploy", and "/home/bvt/.jenkins/userContent/GCP" in "Remote directory". And check "Clean-up remote directory before deployment" and "Delete remote artifacts when the build is deleted" in "Advanced". You can add more artifacts by click "Add" button.
-
Build job GCP-6.20;
-
After build, you can get artifacts at http://10.0.2.74:8088/userContent/GCP, or in the home page of this job;
Note: It seems that ArtifactDeployer can only save artifacts somewhere in the bvt host. There is a "Publish Over" plugin which can send artifacts to remote hosts via ssh(sftp) or ftp protocol.