Skip to content

Commit 0964b60

Browse files
Update README.md
1 parent 44f09a9 commit 0964b60

File tree

1 file changed

+110
-13
lines changed
  • Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml

1 file changed

+110
-13
lines changed

Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml/README.md

+110-13
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,124 @@
22

33
## About
44

5-
Extends or creates a catalog.yml file with data retrieved from GitHub
5+
This tool helps extend or create a `catalog.yml` file by pulling data from a GitHub repository. It automates the extraction of metadata such as description, tags, and repository information to ensure that the catalog YAML file is up-to-date with the repository's data.
66

77
### About DataMiner
88

9-
DataMiner is a transformational platform that provides vendor-independent control and monitoring of devices and services. Out of the box and by design, it addresses key challenges such as security, complexity, multi-cloud, and much more. It has a pronounced open architecture and powerful capabilities enabling users to evolve easily and continuously.
9+
DataMiner is a leading platform for vendor-independent control and monitoring of devices and services. It provides a comprehensive data acquisition and control layer, enabling access to data from on-premises, cloud, or hybrid setups. The platform supports thousands of connectors and allows users to build their own.
1010

11-
The foundation of DataMiner is its powerful and versatile data acquisition and control layer. With DataMiner, there are no restrictions to what data users can access. Data sources may reside on premises, in the cloud, or in a hybrid setup.
12-
13-
A unique catalog of 7000+ connectors already exist. In addition, you can leverage DataMiner Development Packages to build you own connectors (also known as "protocols" or "drivers").
14-
15-
> **Note**
16-
> See also: [About DataMiner](https://aka.dataminer.services/about-dataminer).
11+
For more information, visit [About DataMiner](https://aka.dataminer.services/about-dataminer).
1712

1813
### About Skyline Communications
1914

20-
At Skyline Communications, we deal in world-class solutions that are deployed by leading companies around the globe. Check out [our proven track record](https://aka.dataminer.services/about-skyline) and see how we make our customers' lives easier by empowering them to take their operations to the next level.
15+
Skyline Communications offers world-class solutions to leading companies across the globe, providing tools to streamline their operations. Explore more on [Skyline's proven track record](https://aka.dataminer.services/about-skyline).
2116

2217
## Getting Started
2318

24-
In commandline:
25-
dotnet tool install -g Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml
19+
1. **Install the tool:**
20+
21+
Run the following command in your terminal to install the tool globally:
22+
23+
```bash
24+
dotnet tool install -g Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml
25+
```
26+
27+
2. **Run the tool:**
28+
29+
After installation, you can run the tool by invoking the command below, followed by necessary arguments:
30+
31+
```bash
32+
github-to-catalog-yaml [options]
33+
```
34+
35+
### Purpose
36+
37+
This tool automates the process of generating or updating a `catalog.yml` file for a GitHub repository. It pulls information such as the repository description, GitHub topics, and inferred artifact types to ensure that the catalog file is correctly populated with relevant metadata.
38+
39+
> **Important**: The process will fail if it cannot detect the **Catalog Item Type** from either the repository name or the GitHub topics. Ensure the repository follows naming conventions or uses the appropriate topics to avoid this failure.
40+
41+
## Command Options
42+
43+
The following options are required for the tool to function correctly:
44+
45+
### `--workspace`
46+
47+
- **Description**: The path to the workspace where the `catalog.yml` file is located or will be created.
48+
- **Required**: Yes
49+
- **Example**: `--workspace /path/to/workspace`
50+
51+
### `--github-token`
52+
53+
- **Description**: Your GitHub token, either a Personal Access Token (PAT) or the `secrets.GITHUB_TOKEN` provided by GitHub Actions.
54+
- **Required**: Yes
55+
- **Example**: `--github-token ghp_abc123def456`
56+
57+
### `--github-repository`
58+
59+
- **Description**: The full GitHub repository name in the format `owner/repo` (e.g., `SkylineCommunications/SLC-AS-MediaOps-Apps`).
60+
- **Required**: Yes
61+
- **Example**: `--github-repository SkylineCommunications/SLC-AS-MediaOps-Apps`
62+
63+
### `--debug`
64+
65+
- **Description**: Enables debug logging for more verbose output. By default, this is set to `false`.
66+
- **Required**: No
67+
- **Example**: `--debug true`
68+
69+
## How the Tool Works
70+
71+
The tool follows these key steps to process and update the `catalog.yml`:
72+
73+
1. **Extract Metadata from GitHub**:
74+
The tool pulls essential data such as the repository description, GitHub topics, and repository name.
75+
76+
2. **Check or Generate the Catalog ID**:
77+
If the `catalog.yml` file does not contain an ID, the tool will generate a new one or retrieve an existing ID from the repository.
78+
79+
3. **Update Description**:
80+
If the file is missing a description, the tool fetches the repository description from GitHub and adds it to the catalog file.
81+
82+
4. **Add Tags**:
83+
The tool automatically retrieves GitHub topics and adds them to the catalog YAML as tags.
84+
85+
5. **Infer Catalog Item Type**:
86+
87+
The tool can identify the artifact types either from the repository name or from GitHub topics:
88+
89+
- If the repository follows the naming conventions outlined in the [GitHub Repository Naming Convention](https://docs.dataminer.services/develop/CICD/Skyline%20Communications/Github/Use_Github_Guidelines.html#repository-naming-convention), the tool can automatically detect the type from the repository name itself without needing any GitHub topic.
90+
91+
- If a different naming convention is used, the tool relies on the presence of a GitHub topic with the value of one of the [Artifact Types](#artifact-types) to infer the type.
92+
93+
If neither the repository name follows the convention nor the appropriate GitHub topic is present, the tool will fail to detect the type and will throw an error.
94+
95+
6. **Save or Create the File**:
96+
If the tool successfully processes the metadata, it will save the updated or newly created `catalog.yml` file in the specified workspace.
97+
98+
### Artifact Types
99+
100+
- **AS**: automationscript
101+
- **C**: connector
102+
- **CF**: companionfile
103+
- **CHATOPS**: chatopsextension
104+
- **D**: dashboard
105+
- **DISMACRO**: dismacro
106+
- **DOC**: documentation
107+
- **F**: functiondefinition
108+
- **GQIDS**: gqidatasource
109+
- **GQIO**: gqioperator
110+
- **LSO**: lifecycleserviceorchestration
111+
- **PA**: processautomation
112+
- **PLS**: profileloadscript
113+
- **S**: solution
114+
- **SC**: scriptedconnector
115+
- **T**: testingsolution
116+
- **UDAPI**: userdefinedapi
117+
- **V**: visio
118+
119+
## Example Usage
120+
121+
```bash
122+
github-to-catalog-yaml --workspace "/path/to/workspace" --github-token "ghp_abc123def456" --github-repository "SkylineCommunications/SLC-AS-MediaOps-Apps"
123+
```
26124

27-
Then run the command
28-
github-to-catalog-yaml help
125+
This command extends or creates the `catalog.yml` file in the provided workspace, using data from the GitHub repository `SkylineCommunications/SLC-AS-MediaOps-Apps`.

0 commit comments

Comments
 (0)