Skip to content

CI-license-validation Improvement changes - hf/26.2 #4690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions blazor/getting-started/license-key/CI-license-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ margin-top: 1.5em; margin-bottom: 1.5em;

# Syncfusion license key validation in CI services

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.
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.

The following section shows how to validate the Syncfusion license key in CI services.

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

Expand All @@ -43,7 +45,8 @@ Syncfusion license key validation in CI services ensures that Syncfusion Essenti

The following example shows the syntax for Windows build agents.

```bash
{% tabs %}
{% highlight <lang> tabtitle ="YAML" %}
pool:
vmImage: 'windows-latest'

Expand All @@ -55,7 +58,8 @@ steps:
filePath: $(LICENSE_VALIDATION) #Or the actual path to the LicenseKeyValidation.ps1 script.

displayName: Syncfusion License Validation
```
{% endhighlight %}
{% endtabs %}

## Azure Pipelines (Classic)

Expand All @@ -71,13 +75,15 @@ steps:

The following example shows the syntax for validating Syncfusion license key in GitHub actions.

```bash
{% tabs %}
{% highlight <lang> tabtitle ="YAML" %}
steps:
- name: Syncfusion License Validation
shell: pwsh
run: |
./path/LicenseKeyValidator/LicenseKeyValidation.ps1
```
{% endhighlight %}
{% endtabs %}

## Jenkins

Expand All @@ -87,7 +93,8 @@ The following example shows the syntax for validating Syncfusion license key in

The following example shows the syntax for validating Syncfusion license key in Jenkins pipeline.

```bash
{% tabs %}
{% highlight json %}
pipeline {
agent any
environment {
Expand All @@ -101,14 +108,27 @@ pipeline {
}
}
}
```
{% endhighlight %}
{% endtabs %}

## Validate the License Key Using ValidateLicense() Method

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

* 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.

{% tabs %}
{% highlight c# %}
using Syncfusion.Licensing;

//Register Syncfusion license key
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");

//Validate the registered license key
bool isValid = SyncfusionLicenseProvider.ValidateLicense(Platform.Blazor);
{% endhighlight %}
{% endtabs %}

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

* If ValidateLicense() method returns true, registered license key is valid and can proceed with deployment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY
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.
* 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.

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.

## Blazor Web App

Open **~/Program.cs** file and register the Syncfusion Blazor license key in the Blazor web app.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.