|
| 1 | +# Getting Started with Skyline DataMiner DevOps |
| 2 | + |
| 3 | +Welcome to the Skyline DataMiner DevOps environment! |
| 4 | +This quick-start guide will help you get up and running. |
| 5 | +For more details and comprehensive instructions, please visit [DataMiner Docs](https://docs.dataminer.services/). |
| 6 | + |
| 7 | +## Creating a DataMiner Application Package |
| 8 | + |
| 9 | +This project is configured to create a `.dmapp` file every time you build the project. |
| 10 | +When you compile or build the project, you will find the generated `.dmapp` in the standard output folder, typically the `bin` folder of your project. |
| 11 | + |
| 12 | +When you publish the project, a corresponding item will be created in the online DataMiner Catalog. |
| 13 | + |
| 14 | +## The DataMiner Package Project |
| 15 | + |
| 16 | +This project is designed to create multi-artifact packages in a straightforward manner. |
| 17 | + |
| 18 | +### Adding Extra Artifacts in the Same Solution |
| 19 | + |
| 20 | +You can right-click the solution and select **Add** and then **New Project**. This will allow you to select DataMiner project templates (e.g. adding additional Automation scripts). |
| 21 | + |
| 22 | +> [!NOTE] |
| 23 | +> Connectors are currently not supported. |
| 24 | +
|
| 25 | +Every **Skyline.DataMiner.SDK** project, except other DataMiner package projects, will by default be included within the `.dmapp` created by this project. |
| 26 | +You can customize this behavior using the **PackageContent/ProjectReferences.xml** file. This allows you to add filters to include or exclude projects as needed. |
| 27 | + |
| 28 | +### Adding Content from the Catalog |
| 29 | + |
| 30 | +You can reference and include additional content from the Catalog using the **PackageContent/CatalogReferences.xml** file provided in this project. |
| 31 | + |
| 32 | +1. Obtain an **Organization Key** from [admin.dataminer.services](https://admin.dataminer.services/) with the following scopes: |
| 33 | + - **Register catalog items** |
| 34 | + - **Read catalog items** |
| 35 | + - **Download catalog versions** |
| 36 | + |
| 37 | +1. Securely store the key using Visual Studio User Secrets: |
| 38 | + |
| 39 | + 1. Right-click the project and select **Manage User Secrets**. |
| 40 | + |
| 41 | + 1. Add the key in the following format: |
| 42 | + |
| 43 | + ```json |
| 44 | + { |
| 45 | + "skyline": { |
| 46 | + "sdk": { |
| 47 | + "dataminertoken": "MyKeyHere" |
| 48 | + } |
| 49 | + } |
| 50 | + } |
| 51 | + ``` |
| 52 | + |
| 53 | +### Importing from DataMiner |
| 54 | + |
| 55 | +You can import specific items directly from a DataMiner Agent: |
| 56 | + |
| 57 | +1. Connect to an Agent via **Extensions > DIS > DMA > Connect**. |
| 58 | + |
| 59 | +1. If your Agent is not listed, add it by going to **Extensions > DIS > Settings** and clicking **Add** on the DMA tab. |
| 60 | + |
| 61 | +1. Once connected, you can import specific DataMiner artifacts: in your **Solution Explorer**, navigate to folders such as **PackageContent/Dashboards** or **PackageContent/LowCodeApps**, right-click, select **Add**, and select **Import DataMiner Dashboard/Low Code App** or the equivalent. |
| 62 | + |
| 63 | +## Executing Additional Code on Installation |
| 64 | + |
| 65 | +Open the **ISS Tracker.cs** file to write custom installation code. Common actions include creating elements, services, or views. |
| 66 | + |
| 67 | +**Quick tip:** Type `clGetDms` in the `.cs` file and press **Tab** twice to insert a snippet that gives you access to the **IDms** classes, making DataMiner manipulation easier. |
| 68 | + |
| 69 | +## Does Your Installation Code Need Configuration Files? |
| 70 | + |
| 71 | +You can add configuration files (e.g. `.json`, `.xml`) to the **SetupContent** folder, which can be accessed during installation. |
| 72 | + |
| 73 | +Access them in your code using: |
| 74 | + |
| 75 | +```csharp |
| 76 | +string setupContentPath = installer.GetSetupContentDirectory(); |
| 77 | +``` |
| 78 | + |
| 79 | + |
| 80 | +## Publishing to the Catalog |
| 81 | + |
| 82 | +This project was created with support for publishing to the DataMiner Catalog. |
| 83 | +You can publish your artifact manually through Visual Studio or by setting up a CI/CD workflow. |
| 84 | +## Publishing to the Catalog with Complete CI/CD Workflow |
| 85 | + |
| 86 | +This project includes a comprehensive GitHub workflow that adheres to Skyline Communications' quality standards, including static code analysis, custom validation, and unit testing. |
| 87 | + |
| 88 | +### Prerequisite |
| 89 | + |
| 90 | +You need a **SonarCloud Organization**. If you don’t have one, you can create it [here](https://sonarcloud.io/create-organization). |
| 91 | + |
| 92 | +### Steps |
| 93 | + |
| 94 | +1. Create a GitHub repository by going to **Git > Create Git Repository**, selecting GitHub, and filling in the wizard before clicking **Create and Push**. |
| 95 | + |
| 96 | +1. In GitHub, go to the *Actions* tab. |
| 97 | + |
| 98 | +1. Click the workflow run that failed (usually called *Add project files*). |
| 99 | + |
| 100 | +1. Click the "build" step that failed and read the failing error. |
| 101 | + |
| 102 | + ``` text |
| 103 | + Error: DATAMINER_TOKEN is not set. Release not possible! |
| 104 | + Please create or re-use an admin.dataminer.services token by visiting: https://admin.dataminer.services/. |
| 105 | + Navigate to the right Organization then go to Keys and create/find a key with permissions to Register catalog items, Download catalog versions and Read catalog items.. |
| 106 | + Copy the value of the token. |
| 107 | + Then set a DATAMINER_TOKEN secret in your repository settings: **Dynamic Link** |
| 108 | + ``` |
| 109 | + |
| 110 | + You can use the links from the actual error to better address the next couple of steps. |
| 111 | + |
| 112 | +1. Obtain an **Organization Key** from [admin.dataminer.services](https://admin.dataminer.services/) with the following scopes: |
| 113 | + - **Register catalog items** |
| 114 | + - **Read catalog items** |
| 115 | + - **Download catalog versions** |
| 116 | + |
| 117 | +1. Add the key as a secret in your GitHub repository, by navigating to **Settings > Secrets and variables > Actions** and creating secrets or variables with the required names. |
| 118 | + |
| 119 | +1. Re-run the workflow. |
| 120 | + |
| 121 | +The following secrets and variables will have been added to your repository after all issues are resolved: |
| 122 | + |
| 123 | +| Name | Type | Description | Setup Guide | |
| 124 | +|-----------------|---------|----------------------------------------------------|---------------------------------------------------------------------------------------------| |
| 125 | +| `DATAMINER_TOKEN` | Secret | Organization key for downloading/publishing from/to the Catalog | Obtain from [admin.dataminer.services](https://admin.dataminer.services/) and add it as a secret. | |
| 126 | +| `SONAR_TOKEN` | Secret | Token for SonarCloud authentication | Obtain from [SonarCloud Security](https://sonarcloud.io/account/security) and add it as a secret. | |
| 127 | +| `SONAR_NAME` | Variable | SonarCloud project ID | Visit [SonarCloud](https://sonarcloud.io/projects/create), copy the project ID, and add it as a variable. | |
| 128 | + |
| 129 | +### Releasing a Version |
| 130 | + |
| 131 | +1. Navigate to the **<> Code** tab in your GitHub repository. |
| 132 | + |
| 133 | +1. In the menu on the right, select **Releases**. |
| 134 | + |
| 135 | +1. Create a new release, select the desired version as a **tag**, and provide a title and description. |
| 136 | + |
| 137 | +> [!NOTE] |
| 138 | +> The description will be visible in the DataMiner Catalog. |
0 commit comments