...
Download the Kyvos CICD Utility.
Export Utility
Anchor | ||||
---|---|---|---|---|
|
Prerequisites
To use the Export utility, you must have the following.
...
Parameter | Description |
KYVOSURL | Kyvos URL of the environment from which you need to export. For example, http://192.192.10.10:8081/kyvos/ |
KYVOSUSERNAME | Username to log into Kyvos (provide the native username). |
KYVOSPASSWORD | Password to log into Kyvos (password of native user needs to be provided). |
CUBEDETAILS | Provide details of the semantic model which needs to be exported in the format "FolderName":["Semantic model Name"], Scenarios and examples are mentioned after this table in cases where multiple entities need to be exported. |
DRDDETAILS | Provide the details of the relationship that needs to be exported in the format "FolderName":["DRDName"], Scenarios and examples are mentioned after this table in cases where multiple entities need to be exported. |
RFDETAILS | Provide the details of the dataset that needs to be exported in the format "FolderName":["RFName"], Scenarios and examples are mentioned after this table in cases where multiple entities need to be exported. |
WBDETAILS | Provide the details of the Workbooks that need to be exported in the format "FolderName":["WorkbookName"], Scenarios and examples are mentioned after this table in cases where multiple entities need to be exported. |
EXPORTCUBE | Allows you to export semantic model objects. Set the value as Y to enable export. Else, set it as N. |
EXPORTDRD | Allows you to export DRD objects. Set the value as Y to enable export. Else, set it as N. |
EXPORTRF | Allows you to export dataset objects. Set the value as Y to enable export. Else, set it as N. |
EXPORTWB | Allows you to export Workbook objects. Set the value as Y to enable export. Else, set it as N. |
GITLOCALREPOPATH | The path of the GITRepo folder is used as the staging location. The folder is available in the Export utility folder. Provide the path of the GIT Repo folder. Note: Please use the forward-slash (/) in the repo path as mentioned in the example and config file snippet above. |
GITHUBNAME | GITHub Name to connect to GIT Repo. For example: ‘Git’ is the hub name for the open source https://Git.com/. Similarly, for the enterprise Git you can mention the enterprise-specific name as GitNAME. |
GITORGNAME | In case your GIT Repo is part of a defined ‘Organizations’ on Git, then please use the Org name as the GITORGNAME, Else you can keep it as blank. In that case, your personal GIT Repo will be used to connect and export. |
GITUSERNAME | Git username to connect with GIT Repo. |
GITFEATUREBRANCHNAME | Git feature branch name where the XML entities will get exported. For example, “working” |
GITPUSH | Allows you to push the exported data to Git. Set the value as Y to push the exported data to Git. |
GITFEATUREBRANCHCLEAN | This parameter allows you to clean the GIT Feature branch before a fresh export. |
GITREPONAME | Git Repo Name where the entities will get exported. |
GITTOKEN | The Personal Access Token for Authentication with user’s GIT account. In case you do not have the Personal Access token, you can create it using the steps explained in the Kyvos CICD Utility#Appendix Appendix. |
Below are several scenarios to export multiple semantic models, relationships, and dataset entities in single export using the config.json if the respective values are set as Y.
#Appendix
Export single entity present from a single folder
"CUBEDETAILS": { "Folder1" : [ “Cube1”] }
"DRDDETAILS": { "Folder1" : [ “DRD1”] }
"RFDETAILS": { "Folder1" : [ “RF1”] }
"WBDETAILS": { "Folder1" : [ “WB1”] }
Export multiple entities from a single folder
"CUBEDETAILS": { "Folder1" : [ “Cube1”, “Cube2”] }
"DRDDETAILS ": { "Folder1" : [ “DRD1”, “DRD2”] }
"RFDETAILS": { "Folder1" : [ “RF1”, “RF2”] }
"WBDETAILS": { "Folder1" : [ “WB1”, “WB2”] }
Export multiple entities from multiple folders
"CUBEDETAILS": { "Folder1" : [ “Cube1”,”Cube2”], “Folder2” : [“Cube3” ] }
"DRDDETAILS ": { "Folder1" : [ “DRD1”,” DRD2”], “Folder2” : [“DRD3” ] }
"RFDETAILS": { "Folder1" : [ “RF1”,” RF2”], “Folder2” : [“RF3” ] }
"WBDETAILS": { "Folder1" : [ “WB1”,” WB2”], “Folder2” : [“WB3” ] }
Export All entities from one or more folders
"CUBEDETAILS": { "Folder1" : [], “Folder2” : [] }
"DRDDETAILS ": { "Folder1" : [], “Folder2” : [] }
“RFDETAILS": { "Folder1" : [], “Folder2” : [] }
“WBDETAILS": { "Folder1" : [], “Folder2” : [] }
Export single/multiple entities from ROOT (when entities are not a part of any folder)
"CUBEDETAILS": { "ROOT" : [ “Cube4”, “Cube5”] }
"DRDDETAILS ": { "ROOT" : [ “DRD4”, “DRD5”] }
"RFDETAILS": { "ROOT" : [ “RF4”, “RF5”] }
"WBDETAILS": { "ROOT" : [ “WB4”, “WB5”] }
Export ALL entities, which includes all entities at ROOT and all folders with all entities
“CUBEDETAILS": { }
“DRDDETAILS ": { }
“RFDETAILS": { }
“WBDETAILS": { }
...
Browse to the Export_Executor folder and double-click the exe file to execute it.
The Export utility starts executing. Once the export is complete, you can check the execution logs in the output folder.
The following figure shows a snippet of the Export Utility execution.If the GITPUSH parameter is set as Y in the Config file, then all the entity XML files will get exported to the Git Feature branch in the following order.
A GIT PULL is performed from the feature branch specified in the config file. So that the remote and local repository (GITRepo) are in sync.
The entities are exported to the GITRepo folder from Kyvos, which is a local repository clone of the Git repository, as shown in the following figure.
Entities are then pushed to the Git feature branch, as shown in the following figure. We have used the working feature branch in this case.
If the GITPUSH parameter is set as N in the Config file, then the entities are directly exported to the Output folder in the Export No GIT PULL and GIT PUSH will be performed in this case.
...
In case the Jenkins job is not created and configured, see the section Creating new Project in Jenkins.
In case the Jenkins job is not Integrated with Git Repository, see the section Git settings to integrate with Jenkins.
In case the Git connection is not created in Jenkins, see the section Creating Git Connection in Jenkins.
Once the above steps are completed, you can execute the Deploy Utility using any of the following methods.
...
You can also deploy entities using the DeployKyvosEntities.py Python script. In this case, the Deploy Utility is triggered by executing the following commands using the Jenkins jobs.
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
Important You must have Python 3.x (with the required packages as mentioned in the Python script) installed on the target system to execute the script. |
...
The Personal Access Token is required for authentication of Export Utility with Git. You are required to provide this in the Export Utility config file, as explained in the Export Utility section.
To create a Personal Access Token in Git, perform the following steps.
In your Git account, navigate to Edit Profile.
On the left pane, click Access Tokens.
Give the token a Descriptive name, select the Scopes which define the access for the Personal tokens, and then click the Create personal access token. A token is generated.
...
In Manage Jenkins > System Configuration > Configure System and then follow these steps.
In the Git section, check the Enable authentication for '/project' end-point
Click Add, then choose Jenkins Credential Provider.
Choose Git API token as the token type.
Enter the Git personal access token's value in the API Token field and click Add.
Enter the Git server's URL in the Git host URL.
Click Test Connection, ensuring the connection is successful before proceeding.
After testing the connection, enter the connection name and save.
Anchor | ||||
---|---|---|---|---|
|
...
Login to your Jenkins account and click New Item from the top left of your dashboard.
Enter the name of the item you want to create, select Freestyle project, and click OK. The project is created.
Navigate to the newly created project and select the Configure option, as shown in the following figure.
On the General tab, click on Git Connection and select the connection.
On the Source Code Management tab, select the Git option on the left and provide your Git Repository URL and Credentials in the corresponding fields.
Change the Branch Specifier as shown in the below screenshot */main this is the branch we intend to build using Jenkins. In this example, we have selected main to Build.
Select the Repository Browser as Auto.
In Additional Behaviours, select the Wipe out repository & force clone option to erase the local repository and clone the fresh repository every time to avoid inconsistency.
On the Build Triggers tab, select Build when a change is pushed to Git
It is used to execute the Deploy Utility as soon entities are merged from the Feature branch to the Master branch in Git repository mentioned in Jenkins above.
Anchor | ||||
---|---|---|---|---|
|
Click Advanced to generate the secret token required for configuring Webhooks.
On the Build Steps tab, select the Execute Window batch command and enter the command (explained in the Deploy Utility section) to execute the Utility.
Click the Save button to save your changes.
...
In your Git Account, select the repository you want to integrate with Jenkins and go to Settings.
Select the Webhooks option from the left pane.
In the URL, enter the URL and append “/project/project name” to this URL, as shown in the figure below, and enter the secret token. To generate the secret token, check the section Creating secret token in Jenkins). For example, http://localhost:8080/project/Git
Select Push events in the trigger and then click Add webhook.