Archieve artificate is copies wrong artifacts - jenkins

I have jenkins job which copies artifacts from another job using Copy Artifacts from another job configuration, when we run the job alone it copies latest successful build artifacts, however when we try to run it from up stream job it is wrongly copying artifacts
In both scenarios it should copy latest artifacts

Related

Does 'Archive artifacts only if build is successful' set as true means, any artifacts won't be created in Jenkins if build fails?

I am running a an automation script in Jenkins . Does 'Archive artifacts only if build is successful' set as true means, any artifacts won't be created in Jenkins if build fails ? OR does this means the artifacts are created in the specified folder,but they are not saved for later and once delete workspace is run,the artifacts created will be gone forever.
Archiving artifacts in jenkins means that the artifacts will be saved on the Jenkins master (for later usage). Even if the job is finished and the workspace is cleaned.
For example for maven this setting means: if your maven build is successful (no failures) then the created artifacts (jars, wars or an ear) will be archived/stored on the Jenkins master and you can safely clean the workspace.
I don't know mortar but in your case this will probably also mean: if the build is successful on your Jenkins slave, then your Artifacts will be copied to the jenkins master and stored there. If you clean your workspace after the build or just not isn't related.

How to totally avoid creating Jenkins Artifacts after each build?

I am running my wedriverio(selenium wrapper in javascript) tests on Jenkins
After each build the jenkins creates and attaches artifacts which is taking very long time (the test cases complete in 2 minutes, but the artifact steps take about 1 hr).
I also noticed that artifact is allure-report.zip
Is there any significance of this artifact if I already have console logs and allure-reports generated?
How to not generate and attach artifact after each build?
Jenkins has no control over the artifacts being created after starting a build via the execute shell command. The build itself is what creates artifacts. Parts of the build process that can also create artifacts are post-build actions such running tests or plugins.
I suggest you familiarize yourself with your Jenkins job to locate what creates the allure_report.zip file.
With Jenkins you can control which artifacts you want to preserve and make available easily on the UI via the Archive the artifacts in Post-build Actions. This does not create the artifacts. It simply tags and archives them as something special to be available outside of the workspace. If this is the step you think is slow (attaching the generated allure_report.zip file), you can remove it from the list of files to archive.

Jenkins - access archived artifacts from downstream job

I'm a little confused on what exactly jenkins (2.74) is doing when archiving artifacts from a maven project. It appears from the logs that jenkins is automatically archiving artifacts in the project without having to specify a post-build action. The artifact files are indeed in the jobs/<project>/modules subdirectory and are available for download from the jenkins webui.
When triggering a follow-on job, I've added a build step to copy artifacts from the upstream (which build: upstream build that triggered this job) without specifying artifacts. The log files for the downstream state that is has copied artifacts from the upstream job. But I'm unable to see them in the workspace.
Are the artifacts available to the downstream job? If so, where are they?
Or do I need to explicitly archive the artifacts (with filenames) in the upstream job and explicitly copy the artifacts by filename in the downstream job?
In your downstream job, you should set this kind of configuration:
To specify the artifacts you want to retrieve from your upstream job and where you can to copy them.
In your case, we copy the openidm-zip file into a local "archives" folder.

Jenkins - copy artifact from parent job only

I have a multi-module Maven project like this:
Parent_Project
Module_A
Module_B
Module_C
I have a Jenkins job that builds the project and archives some artifacts using an Archive the artifacts post-build action.
I have a second Jenkins job where I want to copy one of the archived artifacts using the Copy artifacts from another project build step.
Now, if I configure it like this in Jenkins:
#Copy artifacts from another project
Project name: PARENT_PROJECT
i receive the following warning:
Artifacts will be copied from all modules of this Maven project;
click the help icon to learn about selecting a particular module.
... and Jenkins will indeed loop through all the modules, including the parent project and eventually find the artifact.
But is there a way to configure Jenkins to ONLY look for the archived artifacts in the parent project (and ignore artifacts from the modules)?

Promote only a selected artifact file

We have a build project which always generates three files (artifacts). When promoted, these files will be used for a setup package. With the promoted builds plugin, it's only possible to promote all artifacts of a build. Is there a way to only promote selected files of a build? Currently I can only think of splitting up the build process into separate projects - but then we've the problem with different workspaces.
Thanks a lot.
The Promoted Builds plugin by itself does not "promote" the artifacts. It promotes a build run.
Part of the promotion process may be a Copy Artifacts step, and that is the step that takes the artifacts from promoted build run and does ... whatever you have configured for the promotion.
In the Copy Artifacts step, you can definitely specify a pattern for the files to copy.

Resources