Thursday 4 July 2013

Deploying K2 Black Pearl Project to INT or Production


Developing and deploying K2 black pearl on a development machine doesn't take a lot of effort but just few clicks, however when you want to deploy project to integration or production server you will need to create a deployment package. Once you get deployment project files you can use MSBUILD.exe to deploy it on Production server.

You can also deploy it remotely to production server as far as you are trying to deploy it within domain and port 5555 is enabled to communicate with other servers as other wise you will get connection refused or lost errors while deploying.

Follow steps below to create a package using Visual Studio 2010 and deploy it on Integration server with just K2 Black Pearl on it using MSBUILD,


  • Build your project so that you get the latest DLLs in your debug or release folder.



  • Right click on project and then click on "Create Deploy Package" as shown in picture below, you only get this option if you would had installed K2 BP extension for Visual Studio 2010.





  • Above steps will create a deployment package at directory,

    Directory To Your Project\Project Folder Name\Project Process Files\obj\Release
    //if your build is release then deployment project will be created or updated in release folder


  • Release folder has all the files you need for deployment so take it your K2 BP production server (with K2 BP already installed on it) and open Visual Studio command prompt or check this post out to see how to open VS command prompt.
  • Execute following commands one by one to deploy package to server,

    cd C:\Windows\Microsoft.NET\Framework\v2.0.50727

    MSBUILD "C:\Users\deploymentAccount\Desktop\Release\Deployment\myDeploymentFile.msbuild" /p:Enivronment=INT



Now if you receive this error,

Build FAILED.
C:\Users\deploymentAccount\Desktop\Release\Deployment\myDeploymentFile.msbuild(235,5): error : SmartObject Server Exception: Could not publish SmartObject Definition to server: Error refreshing Service Instance 'WorkflowReportingService'. Service returned : 'Workflow Reporting SO Service: MSDTC on
 server 'Database Server' is unavailable.
C:\Users\deploymentAccount\Desktop\Release\Deployment\myDeploymentFile.msbuild(235,5): error : '.
C:\Users\deploymentAccount\Desktop\Release\Deployment\myDeploymentFile.msbuild(235,5): error : . SmartObject: [My Project (20) Process Instances]
C:\Users\deploymentAccount\Desktop\Release\Deployment\myDeploymentFile.msbuild(235,5): error :
0 Warning(s)
1 Error(s)


Then remove following lines from file with MSBUILD extension in your deployment folder only if you didn't used smart objects,

    <Create_Workflow_SmartObjects>True</Create_Workflow_SmartObjects>
    <Create_Workflow_Reporting_SmartObjects>True</Create_Workflow_Reporting_SmartObjects>

In our environment, we are not using smart objects but while creating deployment package it just adds above lines and while deploying errors, so removing above lines result in successful deployment.

No comments:

Post a Comment