The below XML code sample shows the properties set for a deployment:
- Test the environment to ensure that the Deploy Package’s process will run within the given environment. This is done by setting the TestOnly flag to ‘true’, and the Deploy_Processes flag to ‘false’.
- After the environment has been tested, set the TestOnly flag to ‘false’, and the Deploy_Processes flag to ‘true’. This will deploy the proceses to the target K2 Server.
Using the MSBUILD Application
The MSBUILD application is provided as a tool with the .NET 2.0 Framework. The .NET 2.0 Framework must be installed on the machine in order to use the deploy package.
|Note: The MSBUILD Application is a command line application and must be run from a command prompt (i.e., there is no user interface available).|
As shown in Figure 5, the MSBUILD Application can be located using Windows Explorer, but cannot be run from there.
[Figure 5. The location of the MSBUILD utility]
|Note: Figure 5 demonstrates the relationship between using the command prompt and where the MSBUILD executable is physically located. To use the MSBUILD utility, you must run it from a command prompt, as explained below.|
To run the MSBUILD utility:
1. Open a command prompt (click on Start > Run and type in CMD and press ENTER)
2. At the prompt, type in cd \Windows\Microsoft.NET\Framework\V2.0.50727 and press ENTER
3. For help on using the application, type MSBUILD /? and press ENTER
|Note: You can set an environment path variable to make the MSBUILD utility available at any command prompt. At a command prompt, type in |
C:\ SET PATH = “C:\WINDOWS\Microsoft.NET\Framework\V2.0.50727” and then press ENTER.
Example: Using MSBUILD
|Note: You must log in as an account that has export rights on the target K2 Server in order to deploy a process.|
The two examples below will assist in deploying the package to a new environment. For further assistance in using MSBUILD, please refer to the Microsoft Documentation.
For the following examples, the following assumptions are made:
- The [FileName] is the full path to the MSBUILD File. For example, if you have a project named “Expense Claims Process” located at “C:\Visio Expense\”, the FileName above should be “C:\Visio Expense\obj\Debug\Deployment\Expense Claims Process.msbuild”
- The [Environment] is the name of the environment you are deploying to. For example, Development or Production
Testing the Environment
To test the environment settings without deploying the package, use the TestOnly flag.
Use the following syntax:
MSBUILD [FileName] /p:TestOnly=True;Environment=[Environment]
If no errors are reported by this command your environment is most likely suitable to deploy the package. You may now proceed to deploy the package.
Deploying the Package
To deploy the package, use the following syntax:
MSBUILD [FileName] /p:Environment=[Environment]
Using our assumptions above, the following command could be used to test the deployment environment:
MSBUILD “C:\Visio Expense\obj\Debug\Deployment\Expense Claims Process.msbuild” /p:TestOnly=True;Environment=Production
To deploy using our assumptions above, the following command could be used:
MSBUILD “C:\Visio Expense\obj\Debug\Deployment\Expense Claims Process.msbuild” /p:Environment=Production