Jenkins Kicking off Downstream Jobs - jenkins

I have a Project A. Project A is listed as dependency in Project B. Whenever I kick off build of project A in Jenkins, once the build is successful, it is kicking of Project B automatically. Is there any way I can stop this or can add a parameter for this step?

Related

Jenkins github pull request builder do not trigger downstream projects

I recently set up github pull request builder on jenkins and it works well when I commented the trigger phrase on the PR. But when I tried to run multiple jobs by setting the downstream upstream relationship, I met this problem which is jenkins triggered the job job A set up by pull request builder as normal, but wouldn't trigger the downstream job job B when job A has finished.
Here are some of settings:
In job A: just everything on the instruction page of the github pull request builder
In job B: Under Build Triggers section, I checked Build after other projects are built and set the projects to watch to be job A, and checked Trigger only if build is stable (Nothing about github pull request builder on job B)
Try doing this from the upstream project, instead. From the upstream project configuration, Add post-build action --> Build other projects, then enter the name of the project to build.

Copy artifacts from specific promoted build

I have two jobs in Jenkins. First of the name “Build” and the second of the name “Deploy to test environment”. In the first job, tester sets promotion manually, and then only promoted builds can be deployed. In second job I added “Promoted Build Parameter” which generates combobox with promoted builds but I can’t connect the value of this parameter with “Copy artifact from another project” build step.
So how can I copy artifacts from the selected promoted build?
In your deploy project:
Configure a Promoted Build Parameter named (for example) PromotedBuild
Configure Copy artifacts from another project to Specific build with Build number as ${PromotedBuild_NUMBER}
Also, if you want to trigger the deploy project from your build project, you can do this:
In your promotion process of your build project add Trigger parameterized build on other projects with a Predefined parameter of PromotedBuild_NUMBER=$PROMOTED_NUMBER.

Jenkins: Multiple tasks or build dependent project after first (even if first fails)

I have some reports that I would like to push up to Github after my main project target builds.
These reports should be pushed up whether the first project succeeds or not. Can Jenkins do either of the following:
Specify multiple tasks (like Bamboo).
Build another project after the first, even if the first fails.
Reading your comment on the other Answers I propose this solution for you Jasper
Keep you existing project that builds and generates your reports and create a new project that you might call "report uploader" which only uploads your reports to your git.
1) Main Project Build
this will build you system, run it and test it (resulting in some reports, let's call them REPORT.o)
this project might or might not fail
REPORT.o should be archived as artifacts then the build is finished
the job should always trigger the "report uploader" job - Use the parameterized build trigger plugging
make sure this job has the checkbox wait for downstream jobs (else a new job might be started and overwrite the report files)
2) Report uploader Build
this will project will take arguments from the upstream job to find the artifacts
fetch them and upload them to whatever server you like to have
The same concept is loosely described on jenkins wiki
hope this fits your need
Yes.
With Git publisher you can push to a branch and choose whether or not to only do so when the build succeeds.
There is also a post-build action where you can build other projects and an option to do so even if the build fails.

Does Jenkins Create Upstream/Downstream automatically?

I am using jenkins for continuous integration. I have created seperate views like view A for server A , view B for server B etc.
Each view builds my project based on the server's environment properties.
But i could see that irrelevant upstream and downstream are getting created even when it is not created explicitly. Is there any solution for this? :(
In Jenkins,When you have projects that depend on each other, Jenkins can track which build of the upstream project is used by which build of the downstream project, by using the records created by the fingerprint support.
For this feature to work, the following conditions need to be met:
The upstream project records the fingerprints of its build artifacts The downstream project records the fingerprints of the upstream files it uses This allows Jenkins to correlate two projects.
Because of this, the upstream and downstream might be created automatically. So, in the project configuration, uncheck the option
Build Triggers
Build whenever a SNAPSHOT dependency is built
This will remove all the upstream downstream that are existing even after deleting the streaming dependency explicitly.
Upstream-Downstream relationship is created in two ways:
You trigger a build using build triggers in Post Build actions.
Fingerprinting. In this case if a file is fingerprinted in upstream jobs and is also used and fingerprinted in any other job, both the jobs develop an upstream- downstream relationship.
For the first case you can remove the build trigger to remove Upstream-Downstream relationship.
In the second case, you cannot restrict Jenkins from creating that relationship but can restrict automatic trigger of the downstream job by checking "Disable triggering of downstream projects" option under the Build configuration. This will trigger only those downstream jobs that are explicitly configured to get triggered in post build actions.
Hope this helps.

Jenkins triggering dependent builds only when necessary?

I have the following build scenario:
Project C depends on Project B which depends on Project A
Project X depends on C, Project Y depends on B, Project Z depends on A.
There are many other modules with dependencies, but the most "complex" build relationship is with project X. To set this up in Jenkins, I've used the Parameterized Trigger Plugin, with the "block until triggered project has finished building" option. Each buildable module gets its own Jenkins job, and the plugin is used to block on the necessary dependent build job.
I've run into 2 problems with this setup.
Projects A and B get built many times over as they are in the transitive dependency chain for projects X, Y, Z, etc.
Jenkins, sometimes, gets completely blocked building projects because builds for jobs X, Y, Z, etc. have filled up all available executors (being triggered by scm changes), and the dependent projects are in the queue waiting to be built.
I'm looking for advice on how to configure Jenkins for such a build environment. I'm new to Jenkins so I don't know exactly what options are available to resolve this issue.
EDIT:
All jobs are triggered by SCM changes. Dependent projects are also triggered by the Parameterized Trigger Plugin; the "block until triggered projects finish their builds" options.
Jenkins has multiple ways of triggering builds. Most common is by watching for repository changes.
However, you can also automatically trigger a build after another job finishes building. This is built into Jenkins. Take a look under Build Triggers and select the checkbox Build after other projects are built, or in the Post-Build section, select Build Other Projects post-build action. And, you can have multiple triggers on a build, so a build could happen if a dependency from another project changes or if the source files change.
If you use Maven or Ivy, there are plugins that can be used to trigger a build if a Maven/Ivy jar dependency that the project uses changes.
One more useful plugin is the Copy Artifacts Plugin. This allows you to copy a build artifact from Project "X" to Project "Y" for Project "Y" to use for building.

Resources