Orienteed logo verde y blanco
Go to blog

WebSphere Commerce – Management Center: Jenkins integration

by Rúnar Sverrisson, 3/26/2020, 1:08:26 PM

In this post we want to discuss how Jenkins can be integrated with the Management Center for WebSphere Commerce. We will review a custom implementation of a tool for Management Center and how it can be configured and used your workspace. All relevant code is available on GitHub.

Jenkins Integration Tool

The goal of the tool is to be able to request information from Jenkins and to run builds for jobs. In order to communicate with Jenkins, we implement a custom controller command. This command can be executed in two different ways: Via the Management Center user interface and by a REST call. The REST call is not strictly needed for the tool, but can be useful during development. If you do not need REST capabilities for the command, you can ignore classes and configurations that have explicitly to do with making a REST call.

Get Started

To use the tool, import the git repository files (or relevant parts of them) into your workspace.

  • If you have existing customizations in your workspace, take care to not overwrite them, and only copy relevant sections of the following files:
    • LOBTools/WebContent/WEB-INF/spring-extension.xml
    • LOBTools/WebContent/WEB-INF/src/xml/commerce/shell/ApplicationMenuItems.xml
    • Rest/WebContent/WEB-INF/config/resources-ext.properties
  • In order to execute the Jenkins command as a REST service, we need an access policy in place. Copy the files in DataLoad/xml, to a similar location in the xml folder outside of the workspace (where the rest of the access policies are located). Then load it to the database, by using the acpload.bat script.

Configurations

The tool reads configurations from the STORECONF database table:

integration.jenkins.hostName,
integration.jenkins.port,
integration.jenkins.username,
integration.jenkins.password

To insert data into the STORECONF table, use commands similar to

INSERT INTO WCS.STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES(0, 'integration.jenkins.hostName', 'ThisIsMyHostName', 1);

where, the string ThisIsMyHostName is the host name of the Jenkins server.

Usage

Once the files have been added to the workspace and configurations loaded into the database, the tool is ready to be used. Start up the WebSphere Commerce application and access the Management Center. The following images visualize how the tool functions.

[caption id="attachment_53983" align="aligncenter" width="1828"]integrationToolMenu.jpg Open WebSphere Management Center and select the Integration Tool from the Menu.integrationToolNoSelection.jpg Select the Jenkins object in the Explorer view.integrationToolJobList.jpg This will display a list of all the available jobs on the Jenkins server, along with some basic information about it. Select a job to see the detailed properites view.integrationToolJobProperties.jpg When an object is selected we can execute a build of the job by clicking on the Jenkins build button. We can also refresh the information by clicking on the refresh button in the toolbar. Note that in order to view the console log information the job must be manually refreshed.

Conclusion

We have discussed how to add a custom Jenkins integration tool to WebSphere Management Center and how to use the tool to manage certain Jenkins tasks directly from WC Management Center This is just one example of how one can customize WebSphere Management Center to do all sorts of different tasks. This can add value to business users by decreasing the amount of different tools and simplifying their workflow. Get access to all the relevant code on GitHub.

 

Related posts

Join our mailing list

Want to know more about e-commerce trends, industry articles and events? Subscribe now to our monthly newsletter!

We use cookies to improve your experience and our services by analyzing your navigation on our website. If you continue to browse, we consider that you accept its use. You can learn more by clicking here:
Cookies Policy
Logotipo de Orienteed

Cookies Policy

A cookie is a small text file that is downloaded to your computer when you access certain web pages. Cookies allow web pages, among other things, to store and retrieve information about the device or browsing habits of a user. Depending on the information retrieved, cookies can be used to recognize the user.
Technical Cookies are essential to provide the service offered and requested by a user, to remember configuration preferences, as well as for security and fraud prevention purposes. The website cannot function properly without these cookies.
Analytical cookies help us analyze the activity of users and the number of visitors on the website. They allow the collection of information on the number of visitors, their origin, the browser used, the duration spent on each page, the impact of ads, etc. These cookies are used exclusively for statistical purposes and do not allow identification of particular individuals.

How to deny or revoke cookie consent

Cookies can be blocked or deleted through the browser settings. The following links detail how to do it in each of the most used browsers.