Promoted Build Plugin , can not see Promotions - jenkins

When I am running the Jenkins Job with promotion setup like below ,
I cant see my promotions after the build is completed in the UI .
Please suggest if I am missing something.

Builds that had finished before the promotion was originally created are not "promotable"
Run a new build, and it will show.
Note: this restriction is only on the creation of a new promotion. You can modify the promotion process as much as you need, and it will be executable on older builds without problem (as long as those builds had finished after the original promotion was created)
Edit:
I think I misunderstood your question. It appears you are on the "Promotions History" page, the one at http://$JENKINS_SERVER/$JOB_URL/promotion/. You won't see builds here until they have been triggered for promotion.
To actually trigger a promotion on a build, you have to select the specific build number/job run. Promotions are per job-run, not per job. Each job run has associated promotions with it.
You need to be at http://$JENKINS_SERVER/$JOB_URL/123/promotion/ where 123 is the build number that you want to promote. You can use permalinks instead of 123, such as lastBuild or lastSuccessfulBuild, etc.
To reference to 123 from within the build (in order to use this in email notification links, etc), you can use $BUILD_NUMBER variable.
Through the UI, you need to select a build from the build history, click
"Promotion Status" there, and then approve/trigger a promotion (I know it's confusing since both "history page" and "trigger/execution" pages have the same name for the link.)

First you have to promote the build then you can see that particular build in promotion status.
First click on build number that you want to promote then click click on promotion status from late panel. Here you will see the user who can promote the build.
Then you have to approve it for the promotion.

Related

Trigger a downstream project on demand

Given the following situation
main-job builds and tests a project
installer-job copies artifacts from main-job, and packages them into an installer
installer-job is set as downstream project of main-job via Parameterized Trigger Plugin.
But the installer-job should only be triggered on-demand from main-job's build page.
It's possible to trigger the downstream job on the project page:
But it doesn't seem possible to trigger the build from a specific build page.
Is there any option to get such a trigger button on the build page?
Note: It's a freestyle project, not a pipeline one. So things like the Build Pipeline plugin don't help, unfortunately.
An elegant solution is possible via the Promoted Builds Plugin. "Promotion" is some activity that's performed when a build fulfills certain criteria, like
build was successful
all downstream builds passed
explicit, interactive confirmation
In your case, this condition will be simple: just "main-job" needs be successful, and you will want to confirm explicitly.
There's lots of possible steps that can be triggered as promotion activity -- what you want is to trigger a build of the "installer-job", which can be configured easily.
To summarize, for "main-job", you will configure something like this:
When you do that, the 'main-job" builds will feature a "Promotion Status" button. After pressing the "Approve" button there, the promotion will be enabled and the "install-job" will start building:

Jenkins GUI to set time - is there a way to pass parameters from the "build with parameters" screen to the a schedule

I have a couple of jobs with parameters, that let developers choose params from the "build with params" screen.
Now these jobs need to run nightly. BUT -
The nightly parameters' values must be changed every couple of weeks, by some developers.
The developers who must change these values can't have permissions to edit the jobs, just to build them.
So I'm wondering if I could pass some parameters to either the "build periodically" or to the "build periodically with parameters", such that would enable the developers to set the time of a build from the "build with params" screen. Parameters like "minute", "hour" and so on, that will be written in the build periodically" like so: ${minute} ${hour} ${DOM} ${Month} ${DOW}.
This will enable the devs to set a nightly build on their own, or even an afternoonly or morningly, without editing the jobs... What do you say?
I see that the the "build peri" gives an error for adding ${minute} (invalid input). Could this be done in some other way?
I ended up giving the dev team a multijob that's built periodically, runs the jobs with predefined parameters, and is editable by the devs.
That gives them an not-really-GUI-place in which to set params and a schedule to the jobs without editing the jobs themselves. Doesn't look like much but it solves my problem.

Is there a way to display promotion status in Jenkins next to each build history?

In Jenkins we can promote the build for each build number.
I want to display the status of promotion in the right side of each build in build history box?
Otherwise is it possible to list all the builds which needs to be promoted in a seperate page?
That's exactly where they are supposed to be displayed. After the promotion has been executed, you will see a promotion star there.

Difference between Jenkins Job and Project

When I am on the main Jenkins screen, I get a link to Create a New Job.
When I create a new job and call it 'New Job' and run it I get results. When I review the results, I get a link to Back to Project. When I click this I see Project New Job on the top of the page.
So is a job and a project the same thing in Jenkins? Or are the names used interchangeably?
This puzzled me quite a bit, too, and although this is an old question I thought I'd expand #Jan's comment with some content from the discussion he linked, as it might help other users.
From the Jenkins CI forum:
A project is a special case of a job, i.e. all projects are jobs, but
not all jobs are projects.
Perhaps it helps to extend mentally the names to "general purpose
jobs" and "software building projects" (although the latter don't need
to build software, they are tailored to this use case).
In the case of "new job", Jenkins can't know yet if the new job
will be of the project subtype. On the other hand, once you have chosen
to create a project, this is reflected as specific as possible in the UI
("Project Foo"). If you look at the precise wording on the "New Job"
page, you'll realize the subtle differences (e.g. "Build a free-style
software project" as opposed to "Monitor an external job").
An example of a job that is not a project is the lesser known
"external job" that receives notifications from events that happen
outside Jenkins, but should be tracked inside Jenkins (e.g. system
restarts, etc.). See
https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs for
more about this job type.
For the records, this is the actual class model used by Jenkins internally
(extending sub-classes are indented below their super-class):
Job
AbstractProject
MatrixProject (a.k.a. "multi-configuration project")
Project
FreeStyleProject
MatrixConfiguration (a single configuration of a matrix project)
StubJob
ViewJob
ExternalJob
Only FreeStyleProject, MatrixProject, and ExternalJob are visible on the
"New Job" page.
Yes, they mean totally the same thing! Below is from the Jenkins guide:
Setting up the project
Go to Jenkins top page, select "New Job", then choose "Build a
free-style software project". This job type consists of the following
elements:
It seems the project is the job. Actually when you "create a new job", you will see four types of jobs, and three of them are described as "project".
Job is a deprecated term that is synonymous with Project. They both mean:
A user-configured description of work which Jenkins should perform, such as building a piece of software, etc.

Jenkins - API to update build status

I am using Jenkins to build my project. When the build is ready, the product is downloaded and tested. I would like to notify Jenkins that the build is tested and then to notify it about the test results. I would like that once jenkis has created the build, it is available to download, but that there is a message like 'build is tested' or 'tests passed/failed'.
Uploading a file with this kind of information would be OK as well.
Is it possible with jenkins?
I do not want to integrate my tests into jenkins build process: they take too long and use too much resources (and must be carried out on a separate machine with dedicated environment)
You can setup 2 promotions on the build job. Call one "Tests Passed" and another "Tests Failed".
The promotions will add different colored "star" icons to the individual builds to indicate which promotions had been executed. All build artifact downloads and other build information is available regardless of promotion status.
If you will be "notifying" Jenkins manually, you just need to manually execute a promotion. You can also access a permalink to the last successful promoted build's artifacts like http://[JENKINS_URL]/job/[JOB_NAME]/[PROMOTION_NAME]/artifact
If you want your test process to notify Jenkins automatically, you would need to trigger it by sending a call to the webpage. You can use CURL to request http://[JENKINS_URL]/job/[JOB_NAME]/[JOB_NUMBER]/Promotion/[PROMOTION_NAME]/build. Of course you need to know the number of the build that you are trying to mark for promotion. Alternatively, you can use the "Last Successful" permalink like http://[JENKINS_URL]/job/[JOB_NAME]/lastBuild/promotion/[PROMOTION_NAME]/build

Resources