Skip to content

Commit 9a3138e

Browse files
author
christopherhirudayasamy
authored
Merge pull request #4910 from syncfusion-content/HF_27
189464 - Updated Latest Content In CI Validation UG Page - hf/27.1
2 parents 8324f15 + 66b031f commit 9a3138e

File tree

2 files changed

+51
-19
lines changed

2 files changed

+51
-19
lines changed

blazor/getting-started/license-key/CI-license-validation.md

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,23 @@ margin-top: 1.5em; margin-bottom: 1.5em;
1919

2020
# Syncfusion license key validation in CI services
2121

22-
Syncfusion license key validation in CI services ensures that Syncfusion Essential Studio components are properly licensed during CI processes. Validating the license key at the CI level can prevent licensing errors during deployment. The following section shows how to validate the Syncfusion license key in CI services.
22+
Syncfusion license key validation in CI services ensures that Syncfusion Essential Studio components are properly licensed during CI processes. Validating the license key at the CI level can prevent licensing errors during deployment. Set up the continuous integration process to fail in case the license key validation fails. Validate the passed parameters and the registered license key again to resolve the issue.
23+
24+
The following section shows how to validate the Syncfusion license key in CI services.
2325

2426
* Download and extract the LicenseKeyValidator.zip utility from the following link: [LicenseKeyValidator](https://s3.amazonaws.com/files2.syncfusion.com/Installs/LicenseKeyValidation/LicenseKeyValidator.zip).
2527

26-
* Open the LicenseKeyValidation.ps1 PowerShell script in a text\code editor.
28+
* Open the LicenseKeyValidation.ps1 PowerShell script in a text\code editor as shown in the below example.
29+
30+
{% tabs %}
31+
{% highlight c# tabtitle="PowerShell" %}
32+
# Replace the parameters with the desired platform, version, and actual license key.
33+
34+
$result = & $PSScriptRoot"\LicenseKeyValidatorConsole.exe" /platform:"Blazor" /version:"26.2.4" /licensekey:"Your License Key"
35+
36+
Write-Host $result
37+
{% endhighlight %}
38+
{% endtabs %}
2739

2840
![LicenseKeyValidation script](images/license-validation.png)
2941

@@ -37,13 +49,14 @@ Syncfusion license key validation in CI services ensures that Syncfusion Essenti
3749

3850
## Azure Pipelines (YAML)
3951

40-
* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
52+
* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
4153

42-
* Integrate the PowerShell task in pipeline and execute the script to validate the license key.
54+
* Integrate the PowerShell task in the pipeline and execute the script to validate the license key.
4355

4456
The following example shows the syntax for Windows build agents.
4557

46-
```bash
58+
{% tabs %}
59+
{% highlight c# tabtitle="YAML" %}
4760
pool:
4861
vmImage: 'windows-latest'
4962

@@ -55,39 +68,43 @@ steps:
5568
filePath: $(LICENSE_VALIDATION) #Or the actual path to the LicenseKeyValidation.ps1 script.
5669

5770
displayName: Syncfusion License Validation
58-
```
71+
{% endhighlight %}
72+
{% endtabs %}
5973

6074
## Azure Pipelines (Classic)
6175

62-
* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
76+
* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
6377

64-
* Include the PowerShell task in pipeline and execute the script to validate the license key.
78+
* Include the PowerShell task in the pipeline and execute the script to validate the license key.
6579

6680
![LicenseKeyValidation script](images/license-validation-classic.png)
6781

6882
## GitHub actions
6983

7084
* To execute the script in PowerShell as part of a GitHub Actions workflow, include a step in the configuration file and update the path of the LicenseKeyValidation.ps1 script file (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
7185

72-
The following example shows the syntax for validating Syncfusion license key in GitHub actions.
86+
The following example shows the syntax for validating the Syncfusion license key in GitHub actions.
7387

74-
```bash
88+
{% tabs %}
89+
{% highlight c# tabtitle="YAML" %}
7590
steps:
7691
- name: Syncfusion License Validation
7792
shell: pwsh
7893
run: |
7994
./path/LicenseKeyValidator/LicenseKeyValidation.ps1
80-
```
95+
{% endhighlight %}
96+
{% endtabs %}
8197

8298
## Jenkins
8399

84-
* Create a [Environment Variable](https://www.jenkins.io/doc/pipeline/tour/environment) named 'LICENSE_VALIDATION'. Use Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
100+
* Create an [Environment Variable](https://www.jenkins.io/doc/pipeline/tour/environment) named 'LICENSE_VALIDATION'. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
85101

86102
* Include a stage in Jenkins to execute the LicenseKeyValidation.ps1 script in PowerShell.
87103

88-
The following example shows the syntax for validating Syncfusion license key in Jenkins pipeline.
104+
The following example shows the syntax for validating the Syncfusion license key in the Jenkins pipeline.
89105

90-
```bash
106+
{% tabs %}
107+
{% highlight json %}
91108
pipeline {
92109
agent any
93110
environment {
@@ -101,17 +118,30 @@ pipeline {
101118
}
102119
}
103120
}
104-
```
121+
{% endhighlight %}
122+
{% endtabs %}
105123

106-
## Validate the License Key Using ValidateLicense() Method
124+
## Validate the License Key By Using the ValidateLicense() Method
107125

108126
* Register the license key properly by calling RegisterLicense("License Key") method with the license key.
109127

110-
* Once the license key is registered, it can be validated by using ValidateLicense("Platform.Blazor") method. This ensures that the license key is valid for the platform and version you are using. For reference please check the following example.
128+
* Once the license key is registered, it can be validated by using the ValidateLicense("Platform.Blazor") method. This ensures that the license key is valid for the platform and version you are using. For reference, please check the following example.
129+
130+
{% tabs %}
131+
{% highlight c# %}
132+
using Syncfusion.Licensing;
133+
134+
//Register Syncfusion license key
135+
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
136+
137+
//Validate the registered license key
138+
bool isValid = SyncfusionLicenseProvider.ValidateLicense(Platform.Blazor);
139+
{% endhighlight %}
140+
{% endtabs %}
111141

112142
![LicenseKeyValidationMethod](images/license-validation-method.png)
113143

114-
* If ValidateLicense() method returns true, registered license key is valid and can proceed with deployment.
144+
* If the ValidateLicense() method returns true, registered license key is valid and can proceed with deployment.
115145

116-
* If ValidateLicense() method returns false, there will be invalid license errors in deployment due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. Please ensure that all the referenced Syncfusion assemblies or NuGet packages are all on the same version as the license key’s version before deployment.
146+
* If the ValidateLicense() method returns false, there will be invalid license errors in deployment due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. Please ensure that all the referenced Syncfusion assemblies or NuGet packages are all on the same version as the license key’s version before deployment.
117147

blazor/getting-started/license-key/how-to-register-in-an-application.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY
2222
N> * Place the license key between double quotes. Also, ensure that Syncfusion.Licensing.dll is referenced in your project where the license key is being registered.
2323
* Syncfusion license validation is done offline during application execution and does not require internet access. Apps registered with a Syncfusion license key can be deployed on any system that does not have an internet connection.
2424

25+
I> Syncfusion license keys can be validated during the Continuous Integration (CI) processes to ensure proper licensing and prevent licensing errors during deployment. Refer to the [CI License Validation](https://blazor.syncfusion.com/documentation/getting-started/license-key/ci-license-validation) section for detailed instructions on how to implement it.
26+
2527
## Blazor Web App
2628

2729
Open **~/Program.cs** file and register the Syncfusion Blazor license key in the Blazor web app.

0 commit comments

Comments
 (0)