acxmatos Contributor.
Contributor.
858 views

Notification when flow cancelled in Central

Hello folks,

We are automating deployment using HPOO. We have a DevOps flow running on Jenkins, which calls HPOO API to start a deployment flow once the code is validated and tested.

The integration works wonderful, we use a callback Url so HPOO can notify Jenkins back once the flow is completed (successfully or not).

But we have a catch to address: if someone cancels the flow execution through Central, I'm not able to callback Jenkins to let it know the flow was cancelled.

I'm wondering if there is a way (an event, a trigger, anything) to detect the flow was cancelled, so I can use the callback Url to notify Jenkins.

Today we have a customized notification component that sends out emails whenever the flow completes. We used this component to add the Jenkins notification, but it won't handle situations when the flow is cancelled.

Is there any standard component able to do that? Is there a global event or trigger I can "catch" on my flow so I know whenever it completes/aborts?

Thanks for your help

0 Likes
5 Replies
Super Contributor.. Brett Simpson_1 Super Contributor..
Super Contributor..

Re: Notification when flow cancelled in Central

Hi,

Sorry, i can't help you with your actual query. I was just wondering though if you'd be able to share your JEnkins operations. I'm new to the whole Jenkins Dev Ops and looking to learn about it. We have OO, and are testing some containerised apps etc. I'd like to look at automating the deployment of new container versions using Jenkins, then doing some other flows from OO against them. Any help appreciated.

cheers

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Notification when flow cancelled in Central

Hi,

Do you use OO Jenkins Plugin to monitor the flow exection? If yes, what is the job status you'll like to have for Canceled state: Unstable, Failed, Success?

Thanks,

Lucian

0 Likes
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: Notification when flow cancelled in Central

As Lucian implied, the OO Jenkins Plugin could help here.  Are you using it?

There is an old video talking about the plugin here: https://youtu.be/ZPn5CuVkDhw?t=8 

The plugin is explained here too: https://wiki.jenkins.io/display/JENKINS/HP+Operations+Orchestration+Automation+Execution+Plugin 

I would suggest a job for the validations/tests you mentioned that would trigger another job with the OO Jenkins plugin triggering the deployment. this second job will run till flow completion. If someone cancels the flow it will be captured in Jenkins so you could handle job status similar to how Lucian implied.

Hope it helps,

Andrei Vasile Truta
0 Likes
acxmatos Contributor.
Contributor.

Re: Notification when flow cancelled in Central

Hello Lucian

We considered using the Jenkins OO Plugin, but we could not make it. We have more than 600 Jenkins jobs, for around 200 systems, so we couldn't use the Freestyle project. We had to create Pipeline projects, and write a base customized pipeline file using Groovy. Basically, we run all our jobs using the same pipeline file, which implements a lot of the specific stuff we have in our company's policies. We also have basic templates for creating jobs, so we don't need to manually create new jobs using the Jenkins GUI.

Unfortunatelly, the Jenkins OO Plugin does not provide pipeline commands, and it can only be used as a build step. So we end up implementing the OO integration using raw API calls, for triggering the OO flows execution. Since our OO flows take some time to run (they do the whole deployment process), we couldn't use the pooling strategy (call the status API every 30 seconds or so, "asking" if the flow finished execution). That's when we came up with the callback Url, we use a plugin in Jenkins to generate an unique callback Url, and pass it to the HPOO flow as an input parameter. Jenkins then enters in "sleep mode", waiting for the callback to be called. Once HPOO is done, it simply use the callback Url to report the execution status (success/failure), and the details of what happened.

As I mentioned, the mechanism works pretty good, except for this small detail, when the flow is manually cancelled in HPOO. It would be a dream if we could have a "global catch" in HPOO, an event or something, just to know the execution is over, to take some action.

Thanks for your reply

0 Likes
acxmatos Contributor.
Contributor.

Re: Notification when flow cancelled in Central

Hello Andrei,

I red somewhere about the two job approach in OO, one "monitoring" the other, but I couldn't quite figure out how to make it happen. We don't use the Jenkins OO plugin (find the details on my other answer), so is your approach possible without the plugin, using plain API calls to OO?

Thanks for your reply

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.