MSBuild /ASP.Net Support Documentation
.Net Pipeline step - As part of this new feature, there have been 3 fields added to the .NET Pipeline Step Configuration. In order to properly use these in the pipeline, you must first add an MS Build job to the Jenkins tool and added the Powershell scripts to the Opsera Script Library. There is also now a ZIP option implementation for MSBuild compile output, with publish of specific ZIP file in Jenkins.
Nexus Repository Pipeline step - There is now an MSBuild step connection in the Nexus Repository step.
This documentation covers prerequisites and setup for these new features.
Jenkins Job Setup
(use Jenkins tool “Windows Jenkins_QA” for screenshots because it’s configured)
In a Jenkins tool, navigate to Jobs tab.
Select +New Jenkins Job button to create a new job.
In the Create New Jenkins Jobs form, select Job Type: Build and Build Type: MS Build.
4. Select the Create button.
Note: Editing this template at a later time will not automatically update the pipeline configuration. Please update the job inside any relevant pipeline step before running the pipeline.
Scripts Setup
To run MS Build pipeline you need to add a Powershell Script to the Opsera Script Library.
To create a Powershell script, navigate to Tool Registry → Scripts and select “New Script” button.
In Create New Script form, set Language to Powershell and enter the Script.
3. Select the Create button and the script will be saved in the Opsera Script Library.
.NET Pipeline Step Configuration
In Step Setup, select Tool: .Net
In Step Configuration, set the following fields to implement MS Build Job.
Jenkins Tool - Select the Jenkins tool containing the MS Build Job.
Jenkins Job - Select Jenkin job with the MS Build Job.
SCM Account - Select an SCM account that was previously added to the selected Jenkin’s account.
Command Line Arguments - Provide custom commands.
Parameter Selection - To add parameters from Tool Registry to be used on custom commands entered in Command Line Arguments.
Opsera Script Library - From the drop down, select the Powershell script.
ZIP option implementation for MSBuild compile output, with publish of specific ZIP file in Jenkins.
The new Zip option implementation is not only specific to MS build, but it is a generic feature that every Build job can use from our pipelines.
As part of this feature there is now added support for Command Line scripts on top of the existing Maven and Gradle builds. You can specifically write Command Line Arguments which can be used on the same workspace. The Maven build job can be converted into a zip file and move it to an external repository.
Output File Path - File path used to set the build artifact path.
Output File Name - File name used to set the build artifact name.
Solution File Path - File path of the entry point to execute the project.
Solution File Name - File name of entry point to execute the project.
Connect the MS Build step to Nexus Repository:
MSBuild Step connection in Nexus artifact upload
In Step Setup, select Nexus Repository as the tool.
In Step Configuration, choose the configured Nexus Repository tool from Tool Registry.