RTC post-build deliver option with Jenkins build - jenkins

Is it possible to execute a Post-build Deliver when using Jenkins server with RTC source?
This is my process;
When a job is started Jenkins connects to RTC Source using the Rational Team Concert plugin and fetches the required code. (Connects to RTC using a build definition which contains details of the workspace to use. This build definition also contains details of the post-build steps)
Jenkins tests/builds/deploys application
Job completes with a status of success.
When I open the results view for the build definition associated with this Jenkins job i notice the absence of any post-build delivery information in the Contribution Summary.
Using the setup I've mentioned should Post-build Delivery be possible?

#niloc,
The ability to initiate a post-deliver option currently only exists in JBE (Jazz Build Engine). There currently is an enhancement open to improve this for the Team Concert Plugin for Hudson/Jenkins ... Teamconcert plugin to trigger Post-Build Events configured in RTC Build Definition.
However, Heather describes a work around in a comment on 05/Dec/13.
Scott

The post-build delivery step can only be set in the build definition with in RTC.
Jenkins won't know anything about it: it doesn't execute that step. RTC does.

Related

Jenkins trigger build URLs

When I configure the job in Jenkins I see the following build trigger URL example:
JENKINS_URL/job/pipeline/build?token=TOKEN_NAME
However, I see a different URL on the Subversion plug-in's page:
http://server/subversion/${UUID}/notifyCommit?rev=$REV
Why are these URLs different? Do they serve different purpose? I assume that contacting the first URL will trigger Jenkins build, and the second one will update SVN working copy used with build jobs.
Why does the plug-in require repository UUID to be present in the URL? Is it required for svn:externals discovery?
Jenkins has multiple different build triggers. "Trigger builds remotely" is one such build trigger, and it takes the following URL format:
JENKINS_URL/job/testgrid/job/testgrid/build?token=TOKEN_NAME
The Subversion hook based build trigger is another build trigger. This is provided by the Subversion plugin which can register its own Servlet/URL. There are other plugins like GitHub plugin (JENKINS_URL/github-webhook/), generic webhook trigger (JENKINS_URL/generic-webhook-trigger/invoke) that register their own URLs as well.
These are different ways of triggering builds. Depending on the plugin used, they may provide specialized functionality though. In your case with Subversion plugin, the $REV parameter tells Jenkins to check out exactly the revision which was reported by the hook.
Here's a screenshot of the build triggers section with trigger builds remotely and GitHub hook trigger enabled:

Jazz build definition from scm

I am looking for scm command which can be used to call RTC build definition from Jenkin's Job.
Earlier, I have tried Team Concert plugin to call build definition from jenkins. However, It has limitation of calling single "build definition".
I need to call multiple "build definition" of different streams from jenkins Job.

How can I get notified if part of my build fails prior to running my Maven goals with Jenkins?

I’m using Jenkins v 1.61 with Java 7. I have a Maven job set up, using SVN for Source Code Management. I have a “Run buildstep before SCM runs” set up (courtesy of the pre-scm-buildstep plugin) and a pre-build step (a short script) set up prior to the Maven goals being run.
My question is, if any of these steps fails, how can I get notified via email of the failure?
Use Jenkins Mailer Plugin, This plugin allows you to configure email notifications for build results.
Plugin ID mailer
Latest Release 1.18
Latest Release Date Sep 04, 2016
Required Core 1.625.3
E-Mail notifications are configured in jobs by adding an E-mail notification Post-build Action. If configured, Jenkins will send out an e-mail to the specified recipients when a certain important event occurs:
Every failed build triggers a new e-mail.
A successful build after a failed (or unstable) build triggers a new
e-mail, indicating that a crisis is over.
An unstable build after a successful build triggers a new e-mail,
indicating that there's a regression.
Unless configured, every unstable build triggers a new e-mail,
indicating that regression is still there.
How about combining pre-scm-buildstep, conditional-buildstep and any-buildstep plugin.
This should allow you to run a publisher step like sending email notifications on a regular build step or a pre scm build step (feature provided by any-buildstep plugin). You could also add a condition check (feature provided by the conditional-buildstep plugin) on the pre-scm-buildstep phase.
You've mentioned that you use a short script prior to the pre-scm-buildstep, just in case you're exporting environment variables as input for your conditional check, remember that you'll also need to write that to a properties file (SEND_EMAIL=true >> my-job.properties) and use env inject plugin to load them on your job environment variables, freestyle jobs don't persist exported shell variables on build steps to be visible to the next steps that come after it.
Lot's of plugins right? Quite annoying. If you want something more elegant, I would recommend using pipeline as code plugin and wrapping everything on a try/catch/finally block, so you could raise an exception before the code checkout stage given a failed check, there are some examples in this article.

run a Jenkins job on another Jenkins instance from the Jenkins job

I want to create a Jenkins job that starts other Jenkins jobs. That would be quite easy, because Jenkins Template Project Plugin allows us to create a build step of a type "use builders from another project". However, what makes my situation harder is that I have to start Jenkins jobs on other machines. Is there any standard way to do that?
In case you want only to trigger new build of Job You Have plenty of ways to accomplish it
you can use remote access API and Trigger a request to build target job from source Job.
https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API
Or you can use https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Remote+Trigger+Plugin
which is handy in handling server details and other stuff. you shoukld ensure ssh keys shared by both servers.

How to get URL of pipeline job in jenkins

We are setting up a continuous delivery pipeline in Jenkins, using the build pipeline plugin.
Our deployment steps uses a proprietary deploy tool (triggered by a HTTP request from jenkins), but we need to have an additional Jenkins step for acceptance tests on the then deployed project. So our deploy tool will need to trigger the last pipeline step.
The jenkins setup for this is obvious:
For a Manually Triggered downstream build step: To add a build step
that will wait for a manual trigger:
Select the Build Pipeline Plugin, Manually Execute Downstream Project check-box
Enter the name(s) of the downstream projects in the Downstream
Project Names field. (n.b. Multiple projects can be specified by using comma, like "abc, def".)
Source: Build Pipeline Plugin
The problem is: I can't seem to find a way to trigger this downstream build through a URL.
In fact I'd need the URL in the deploy job, so I can send it to the deploy tool as a callback URL. Can anybody help?
If I understand correctly, you want to use remote access API, which to my knowledge is no different between general project or pipeline one.
Take a look here:
https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API
Submitting jobs
Jobs without parameters
You merely need to perform an HTTP POST on JENKINS_URL/job/JOBNAME/build?token=TOKEN where TOKEN is set up in the job configuration.
As stated above by #rafal S do
read a file which has list projects name for which build job has to be triggered do a curl HTTP POST on JENKINS_URL/job/${JOBNAME from the file}/build?token=TOKEN within a for loop , where for loop has list of all project names from the file you read

Resources