WebMethods Automated Build and Deployment Guide With Jenkins v01
WebMethods Automated Build and Deployment Guide With Jenkins v01
CI is a development practice that requires developers to integrate code into a shared repository
several times a day. Each check-in is then verified by an automated build, deployment and tests
allowing teams to detect problems early.
Why CI?
1.2 Audience
This document is intended for Development Team, Deployment Team, Infrastructure team who shall
actively participate in the build-release-deploy activities and CI Process.
2.0 Glossary
Abbreviation Description
CI Continuous Integration
IS Integration Server
ESB Enterprise Service Bus
UM Universal Messaging
MWS My webMethods Server
3.0 Assumptions/Prerequisites
ID Description
1 VCS is the source for the build creation.
2 All the dependent assets need to be checked into to VCS (e.g. IS config folder assets for
users, global variables etc.)
3 Deployer and ABE need to be installed in the same environment (often called build server)
where the entire frame work is configured
4 CI Tool (e.g. Jenkins/Maven) should have proper access permissions to required assets
(Matrix given in the following sections)
4.1 VCS
Most widely used SCM tools are SVN, TFS and GIT. GIT SCM has some limitations with
webMethods.
4.5 Deployer
webMethods Deployer is a tool you use to deploy user-created assets that reside on source webMethods
runtimes or repositories to target webMethods runtime components (runtimes).
In a repository-based deployment scenario, Deployer deploys assets built from sources in a VCS and
stored on a repository.
5.0 Process
Process Description
Responsible
STEP DESCRIPTION
component
Designer
Workstation
1 Developer commits the assets to VCS
/WmVCS /Any VCS
Client
Local Service Development model encourages offline development and facilitates the
way to connect with different VCS systems and different versions of the code base.
SVN is most widely is used SCM and is developer friendly. It is recommended to follow the below
structure for this.
TFS is another SCM from Microsoft which has below additional features compared to SVN.
Project management functions, which allow the shaping of a team project based on a user-specifiable
software process, and which enable planning and tracking using Microsoft Excel and Microsoft Project.
Team build, for enabling a common process for building executable products.
Data collection and reporting, which aid in the assessment of a team project's state, based on
information gleaned from Team Foundation Server tools.
The Team Project Portal, which provides a central point of communication for a team project packaged
as a Microsoft Windows SharePoint Services site.
Team Foundation Shared Services, which provide a number of common infrastructure services that
invisible to end users but that are important to toolsmiths and extenders.
You can only create branches with TFS. Below is the recommended structure for TFS.
Git repository is a web-based hosting service, which offers all of the distributed version control
and source code management (SCM) functionality.
This is completely is different from SVN and GIT and works on local repository concept. You will
always have two repositories one is local repository and another one is Remote repository.
It is not possible to pull individual assets from repository either local or remote to your
workspace. The only possibility is to make the workspace as your local repository. E.g. In case of
local development, for working with IS packages, it is mandatory to make the packages folder as
your local repository.
You can create copy of branches whenever stable or intermediate releases are required.
http://jenkins-ci.org/
Install Jenkins by selecting the default options. By default Jenkins runs on the port 8080 and if you wish
to change this to different port, follow the below steps.
Open Jenkins.xml located under <Jenkins Installation Dir> and change the below tag with a different
port number.
Save and close the file and restart the service for applying the saved changes.
TFS: Search with the Filter Team Foundation to search the available plugins if your VCS is TFS.
Navigate to Team Foundation Server Section and provide the TFS Command line client details, in case of
TFS.
Add the ANT target to build.xml to create (using project automator) and deploy projects.
<target name="createProject">
<echo message="Automater file name ....${automater.file}"/>
<if>
<os family="windows"/>
<then>
<exec executable="cmd" dir="${deployer.home}/bin" failonerror="true">
<arg value="/c" />
<arg value="projectautomator.bat"/>
<arg value="${automater.file}" />
</exec>
</then>
<else>
<exec executable="/bin/bash" dir="${deployer.home}/bin" failonerror="true">
<arg value="projectautomatorUnix.sh"/>
<arg value="${automater.file}" />
<target name="importVarSubs">
<copy file="${env.dir}/${var.sub}" todir="${deployer.home}/replicate/inbound"/>
<echo message="Copying the new variable Substitutions...."/>
<echo message="Importing the new variable Substitutions...."/>
<if>
<os family="windows"/>
<then>
<exec executable="cmd" dir="${deployer.home}/bin" failonerror="true">
<arg value="/c" />
<arg value="Deployer.bat"/>
<arg value="--import" />
<arg value="-varsub" />
<arg value="--vsFile" />
<arg value="${var.sub}" />
<arg value="-map" />
<arg value="${proj.map}" />
<arg value="-project" />
<arg value="${proj.name}" />
<arg value="-validate" />
<arg value="false" />
<arg value="-host" />
<arg value="${deployer.host}" />
<arg value="-port" />
<arg value="${deployer.port}" />
<arg value="-user" />
<arg value="${deployer.user}" />
<arg value="-pwd" />
<arg value="${deployer.pwd}" />
</exec>
</then>
<else>
<exec executable="/bin/bash" dir="${deployer.home}/bin" failonerror="true">
<arg value="Deployer.sh"/>
<arg value="--import" />
<arg value="-varsub" />
<arg value="--vsFile" />
</target>
<target name="DeployProject">
<echo message="Deploying the project to .... ${env}...!"/>
<if>
<os family="windows"/>
<then>
<exec executable="cmd" dir="${deployer.home}/bin" failonerror="true">
<arg value="/c" />
<arg value="Deployer.bat"/>
<arg value="--deploy" />
<arg value="-dc" />
<arg value="${proj.dc}" />
<arg value="-project" />
<arg value="${proj.name}" />
<arg value="-host" />
<arg value="${deployer.host}" />
<arg value="-port" />
<arg value="${deployer.port}" />
<arg value="-user" />
<arg value="${deployer.user}" />
<arg value="-pwd" />
<arg value="${deployer.pwd}" />
<arg value="-reportFilePath" />
<arg value="${build.output.dir}" />
</target>
11.1 Check out with Asset Build Environment Vs Check out with CI Tool
Asset Build Environment comes up with build-source-checkout.xml which contains the VCS details and
check out directory. This still works but when check out is triggered every time ABE deletes and starts
checking out the same set even there is no change checked into VCS. Imagine if VCS is having around
100 IS packages. This causes a lot of time consumption.
CI Tools comes up with different types of VCS plug ins which can be configured with a job to perform
VCS updates when new changes are checked into VCS. Following section will help to configure the same.
a. Click on New Item from the left menu and select Build a free-style software project option.
Provide the name and click on ok.
b. Navigate to Source Code Management section in configure link of the Job. Select the VCS type
and map the credentials.
SVN:
GIT:
Navigate to Build section. Click on Add build step, and select Invoke Ant option.
To perform deployment without variable substitution navigate to build section and invoke ant targets
that createProject and DeployProject.
To perform deployment with variable substitution navigate to build section and invoke ant targets that
we have added in section 5.3 in the below order. createProject, importVarSubs and then
DeployProject.