Answer 2: Yes, sharing a workspace is a bad idea. There is the possibility of blocking files. There is a problem with deleting the workspace. Just don't do it ...
Answer 1: you need to Archive assembly artifacts. Thus, artifacts for a particular assembly (by assembly number) will always be available, regardless of whether another assembly is working or not, or in what state the workspaces are in
To archive artifacts
- In your build job, under Post-Build Actions, select Archive Artifacts
- Specify artifacts for archiving (you can use a combination below)
a) You can archive everything: *.*
b) You can archive a specific file using wildcards: /path/to/file_version*.zip
c) You can ignore intermediate directories, for example: **/file_version*.zip - To avoid storage problems with many artifacts, at the top of the configuration you can select Discard old assemblies , click the Advanced button and play with the days to save artifacts and the Maximum number of lines for storing artifacts. Please note that these two settings do not determine how long the actual assemblies last (other settings control this)
To access Jenkins artifacts
- In the assembly history, select any previous assembly that you want.
- In addition to the changes and changes to SCM, you will now have an Artifact Assembly link in which you will find all artifacts for that particular assembly.
- You can also access them with Jenkins permalinks, for example,
http://JENKINS_URL/job/JOB_NAME/lastSuccessfulBuild/artifact/ , and then the name of the artifact.
To access artifacts from another quest
I explained in detail how to access previous artifacts from another deployment job (in your ProductionPush example) here:
How to promote a specific build number from another job in Jenkins?
If your requirements always include the latest build for production, you can skip the promotion setting at the above link. Just follow the steps to set up your deployment job. If you have a deployment task, if it always runs at the same time, just configure the Build periodically . In addition, you may have another task that will run the deployment task based on any conditions that you want.
In any case, above, if the Default Selector parameter is set to Last successful build (as described in the link above), the last build will be transferred to Production
Slav
source share