Overview
Implementing SharePoint Framework solutions is easy. However, maintaining the SPFx solutions for their integrity as they grow is always challenging. When an SPFx solution is being worked on by a team of considerable size and it undergoes continuous development efforts, testing and deployment of the latest released package is a huge task. Setting up CI (Continuous Integration) and CD (Continuous Deployment) helps to automate the process.
Continuous Integration
Continuous Integration (CI) is the process of automating the build and testing of code when a developer commits changes to source control. Commit to source control triggers an automated build which grabs the latest code from version control, builds it, and runs tests on it (if configured). Below are a few benefits of implementing CI.
- Improved productivity of dev team
- Reduced number of bugs
- Early detection of bugs
- Early to market release
Build Pipeline
Build pipeline includes the below major steps,
- Create a build definition
- Install NodeJS
- Restore npm packages
- Build the solution
- Package the solution
- Prepare the Artifacts
- Publish the Artifacts
Create a Build Definition
Build definition contains the definition and configuration for the build. Follow the below steps to create a new build definition.
- Login to Visual Studio Online (Azure DevOps) at https://visualstudio.microsoft.com/vso/
- Select your project to set up a build definition.
- From the left navigation, click Pipelines > Builds.
- Click “New pipeline”.

- Select the source to connect to your source repository. Select your project and branch to build. Click "Continue".

- Under “Select a template”, select “Empty Pipeline”.

- The build definition has a default agent. We can add multiple tasks to the agent to define our build.

Install Node JS
- On the default agent, click the + sign.
- Search for “Node”.
- Add Node.js tool installer.

- Specify the version as 8.x, since SharePoint Framework supports Node version 8.x.







njr spoPosted Jun 2, 2020, 1:38 PM
Good one. Question: this works for a single webpart or an extension. If I have 10 spfx webparts, do we need to add different pipelines? And if I plan to add a 11th one, do we have to add a new one?
Gaurav SPosted Apr 23, 2019, 2:07 AM
Nicely written article
Ano MepaniPosted Apr 12, 2019, 11:15 AM
Superb article and way you described is just awesome.
Ravishankar SinghPosted Apr 12, 2019, 10:24 AM
Nice Article Nanddeep. Good Work :)