Skip to content

Commit f274b32

Browse files
MichielOdajanstaelensskyline
authored andcommitted
Package Project - Support Catalog References
1 parent f4b5043 commit f274b32

File tree

12 files changed

+92
-41
lines changed

12 files changed

+92
-41
lines changed

working/templates/SharedItems/.github/workflows/basic.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
if [[ -z "${{ secrets.DATAMINER_TOKEN }}" ]]; then
3030
echo "Error: DATAMINER_TOKEN is not set. Release not possible!"
3131
echo "Please create or re-use an admin.dataminer.services token by visiting: https://admin.dataminer.services/."
32-
echo "Navigate to the right Organization then go to Keys and create/find a key with permissions to Register Catalog Items."
32+
echo "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."
3333
echo "Copy the value of the token."
3434
repo_url="https://github.com/${{ github.repository }}/settings/secrets/actions"
3535
echo "Then set a DATAMINER_TOKEN secret in your repository settings: $repo_url"
@@ -75,6 +75,7 @@ jobs:
7575
-p:Version="0.0.${{ github.run_number }}" `
7676
-p:VersionComment="${{ steps.findVersionComment.outputs.versionComment }}" `
7777
-p:CatalogPublishKeyName="DATAMINER_TOKEN" `
78+
-p:CatalogDefaultDownloadKeyName="DATAMINER_TOKEN" `
7879
-c Release `
7980
8081
- name: Publish Release
@@ -87,4 +88,5 @@ jobs:
8788
-p:Version="${{ github.ref_name }}" `
8889
-p:VersionComment="${{ steps.findVersionComment.outputs.versionComment }}" `
8990
-p:CatalogPublishKeyName="DATAMINER_TOKEN" `
91+
-p:CatalogDefaultDownloadKeyName="DATAMINER_TOKEN" `
9092
-c Release `

working/templates/SharedItems/.github/workflows/complete.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ jobs:
2929
sonarCloudProjectName: ${{ vars.SONAR_NAME }} # Go to 'https://sonarcloud.io/projects/create' and create a project. Then create a SONAR_NAME variable with the ID of the project as mentioned in the SonarCloud project URL.
3030
# solutionFilterName: "MySolutionFilter.slnf"
3131
secrets:
32-
dataminerToken: ${{ secrets.DATAMINER_TOKEN }} # The API key: generated in the DCP Admin app (https://admin.dataminer.services/) as authentication for a certain DataMiner System.
33-
sonarCloudToken: ${{ secrets.SONAR_TOKEN }} # The API key for access to SonarCloud.
32+
dataminerToken: ${{ secrets.DATAMINER_TOKEN }} # The API key: generated in the DCP Admin app (https://admin.dataminer.services/) as authentication for a certain organization.
33+
sonarCloudToken: ${{ secrets.SONAR_TOKEN }} # The API key for access to SonarCloud.
34+
# overrideCatalogDownloadToken: ${{ secrets.OVERRIDE_DATAMINER_TOKEN }} # Override on the dataminerToken for downloading Catalog items: generated in the DCP Admin app (https://admin.dataminer.services/) as authentication for a certain organization.

working/templates/SharedItems/CatalogInformation/manifest.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# - System Health: If the Catalog item is intended to monitor the health of a system.
1717
# - User-Defined API: If the Catalog item is a DataMiner Automation script designed as a user-defined API.
1818
# - Visual Overview: If the Catalog item is a Microsoft Visio design.
19-
#
2019
type: Custom Solution
20+
2121
# [Required]
2222
# The ID of the Catalog item.
2323
# All registered versions for the same ID are shown together in the Catalog.
@@ -27,36 +27,40 @@ type: Custom Solution
2727
# If the ID is filled in but does exist, properties of the item will be overwritten.
2828
# Must be a valid GUID.
2929
id: 4c5d14ab-9cec-4c0b-8b58-af379fdb4123
30+
3031
# [Required]
3132
# The human-friendly name of the Catalog item.
3233
# Can be changed at any time.
3334
# Max length: 100 characters.
3435
# Cannot contain newlines.
3536
# Cannot contain leading or trailing whitespace characters.
3637
title: $SCRIPTNAME$
38+
3739
# [Optional]
3840
# General information about the Catalog item.
3941
# Max length: 100,000 characters
4042
short_description: This is a custom solution for DataMiner.
43+
4144
# [Optional]
4245
# A valid URL that points to the source code.
4346
# A valid URL
4447
# Max length: 2048 characters
45-
# Note: When Skyline Communications Reusable GitHub workflows are used, this will be automatically filled in.
4648
source_code_url:
49+
4750
# [Optional]
4851
# A valid URL that points to documentation.
4952
# A valid URL
5053
# Max length: 2048 characters
51-
# Note: When Skyline Communications Reusable GitHub workflows are used, this will be automatically filled in.
5254
documentation_url:
55+
5356
# [Optional]
5457
# People who are responsible for this Catalog item. Might be developers, but this is not required.
5558
# Format: 'name <email> (URL)'
5659
# The name is required; max 256 characters.
5760
# The email and URL are optional, and should be in valid email/URL formats.
5861
owners:
5962
- name: '$AUTHOR$'
63+
6064
# [Optional]
6165
# Tags that allow you to categorize your Catalog items.
6266
# Max number of tags: 5

working/templates/SharedItems/SkylineDevopsHelp/GettingStarted.md

+12-9
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ You can publish your artifact either manually via the Visual Studio IDE or by se
4242
### Manual Publishing
4343

4444
1. Obtain an **Organization Key** from [admin.dataminer.services](https://admin.dataminer.services/) with the following scopes:
45-
- **Register Catalog items**
46-
- **Read Catalog items**
45+
- **Register catalog items**
46+
- **Read catalog items**
47+
- **Download catalog versions**
4748

4849
1. Securely store the key using Visual Studio User Secrets:
4950

@@ -55,7 +56,7 @@ You can publish your artifact either manually via the Visual Studio IDE or by se
5556
{
5657
"skyline": {
5758
"sdk": {
58-
"catalogpublishtoken": "MyKeyHere"
59+
"dataminertoken": "MyKeyHere"
5960
}
6061
}
6162
}
@@ -110,8 +111,9 @@ Follow these steps to set it up:
110111
You can use the links from the actual error to better address the next couple of steps.
111112

112113
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**
114+
- **Register catalog items**
115+
- **Read catalog items**
116+
- **Download catalog versions**
115117

116118
1. Add the key as a secret in your GitHub repository, by navigating to **Settings > Secrets and variables > Actions** and creating a secret named `DATAMINER_TOKEN`.
117119

@@ -153,16 +155,17 @@ You need a **SonarCloud Organization**. If you don’t have one, you can create
153155
``` text
154156
Error: DATAMINER_TOKEN is not set. Release not possible!
155157
Please create or re-use an admin.dataminer.services token by visiting: https://admin.dataminer.services/.
156-
Navigate to the right Organization then go to Keys and create/find a key with permissions to Register Catalog Items.
158+
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.
157159
Copy the value of the token.
158160
Then set a DATAMINER_TOKEN secret in your repository settings: **Dynamic Link**
159161
```
160162

161163
You can use the links from the actual error to better address the next couple of steps.
162164

163165
1. Obtain an **Organization Key** from [admin.dataminer.services](https://admin.dataminer.services/) with the following scopes:
164-
- **Register Catalog items**
165-
- **Read Catalog items**
166+
- **Register catalog items**
167+
- **Read catalog items**
168+
- **Download catalog versions**
166169

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

@@ -172,7 +175,7 @@ The following secrets and variables will have been added to your repository afte
172175

173176
| Name | Type | Description | Setup Guide |
174177
|-----------------|---------|----------------------------------------------------|---------------------------------------------------------------------------------------------|
175-
| `DATAMINER_TOKEN` | Secret | Organization key for publishing to the Catalog | Obtain from [admin.dataminer.services](https://admin.dataminer.services/) and add it as a secret. |
178+
| `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. |
176179
| `SONAR_TOKEN` | Secret | Token for SonarCloud authentication | Obtain from [SonarCloud Security](https://sonarcloud.io/account/security) and add it as a secret. |
177180
| `SONAR_NAME` | Variable | SonarCloud project ID | Visit [SonarCloud](https://sonarcloud.io/projects/create), copy the project ID, and add it as a variable. |
178181

working/templates/automation-library-project/$SCRIPTNAME$.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<Version>1.0.0</Version>
1212
<VersionComment>Initial Version</VersionComment>
1313
<!--#if (CreateDataMinerPackage)-->
14-
<!-- Do NOT fill in the Organization Token here. This points to either an Environment Variable skyline__sdk__catalogpublishtoken holding the organization token or a Visual Studio User Secret holding the token. -->
15-
<CatalogPublishKeyName>skyline:sdk:catalogpublishtoken</CatalogPublishKeyName>
14+
<!-- Do NOT fill in the Organization Token here. This points to either an Environment Variable skyline__sdk__dataminertoken holding the organization token or a Visual Studio User Secret holding the token. -->
15+
<CatalogPublishKeyName>skyline:sdk:dataminertoken</CatalogPublishKeyName>
1616
<!--#endif-->
1717
</PropertyGroup>
1818
<ItemGroup>

working/templates/automation-project/$SCRIPTNAME$.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
<Version>1.0.0</Version>
1111
<VersionComment>Initial Version</VersionComment>
1212
<!--#if (CreateDataMinerPackage)-->
13-
<!-- Do NOT fill in the Organization Token here. This points to either an Environment Variable skyline__sdk__catalogpublishtoken holding the organization token or a Visual Studio User Secret holding the token. -->
14-
<CatalogPublishKeyName>skyline:sdk:catalogpublishtoken</CatalogPublishKeyName>
13+
<!-- Do NOT fill in the Organization Token here. This points to either an Environment Variable skyline__sdk__dataminertoken holding the organization token or a Visual Studio User Secret holding the token. -->
14+
<CatalogPublishKeyName>skyline:sdk:dataminertoken</CatalogPublishKeyName>
1515
<!--#endif-->
1616
</PropertyGroup>
1717
<ItemGroup>
18-
<PackageReference Include="Skyline.DataMiner.Dev.Automation" Version="10.2.0.24" />
18+
<PackageReference Include="Skyline.DataMiner.Dev.Automation" Version="10.3.0.24" />
1919
<PackageReference Include="Skyline.DataMiner.Utils.SecureCoding.Analyzers" Version="1.2.3">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

working/templates/gqi-ad-hoc-data-source-project/$SCRIPTNAME$.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<Version>1.0.0</Version>
1111
<VersionComment>Initial Version</VersionComment>
1212
<!--#if (CreateDataMinerPackage)-->
13-
<!-- Do NOT fill in the Organization Token here. This points to either an Environment Variable skyline__sdk__catalogpublishtoken holding the organization token or a Visual Studio User Secret holding the token. -->
14-
<CatalogPublishKeyName>skyline:sdk:catalogpublishtoken</CatalogPublishKeyName>
13+
<!-- Do NOT fill in the Organization Token here. This points to either an Environment Variable skyline__sdk__dataminertoken holding the organization token or a Visual Studio User Secret holding the token. -->
14+
<CatalogPublishKeyName>skyline:sdk:dataminertoken</CatalogPublishKeyName>
1515
<!--#endif-->
1616
</PropertyGroup>
1717
<ItemGroup>

working/templates/package-project/$SCRIPTNAME$.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void Install(IEngine engine, AppInstallContext context)
7575
var installer = new AppInstaller(Engine.SLNetRaw, context);
7676
installer.InstallDefaultContent();
7777

78-
string setupContentPath = installer.GetSetupContentDirectory();
78+
////string setupContentPath = installer.GetSetupContentDirectory();
7979

8080
// Custom installation logic can be added here for each individual install package.
8181
}

working/templates/package-project/$SCRIPTNAME$.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<Version>1.0.0</Version>
1111
<VersionComment>Initial Version</VersionComment>
1212
<!--#if (CreateDataMinerPackage)-->
13-
<!-- Do NOT fill in the Organization Token here. This points to either an Environment Variable skyline__sdk__catalogpublishtoken holding the organization token or a Visual Studio User Secret holding the token. -->
14-
<CatalogPublishKeyName>skyline:sdk:catalogpublishtoken</CatalogPublishKeyName>
13+
<!-- Do NOT fill in the Organization Token here. This points to either an Environment Variable skyline__sdk__dataminertoken holding the organization token or a Visual Studio User Secret holding the token. -->
14+
<CatalogPublishKeyName>skyline:sdk:dataminertoken</CatalogPublishKeyName>
1515
<!--#endif-->
16-
<CatalogDefaultDownloadKeyName>skyline:sdk:catalogdownloadtoken</CatalogDefaultDownloadKeyName>
16+
<CatalogDefaultDownloadKeyName>skyline:sdk:dataminertoken</CatalogDefaultDownloadKeyName>
1717
</PropertyGroup>
1818
<ItemGroup>
1919
<PackageReference Include="Skyline.DataMiner.Core.AppPackageInstaller" Version="2.0.5" />

working/templates/package-project/GettingStarted.md

+34-12
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,30 @@ You can right-click the solution and select **Add** and then **New Project**. Th
2626
Every **Skyline.DataMiner.SDK** project, except other DataMiner package projects, will by default be included within the `.dmapp` created by this project.
2727
You can customize this behavior using the **PackageContent/ProjectReferences.xml** file. This allows you to add filters to include or exclude projects as needed.
2828

29-
<!-- Currently not supported
3029
### Adding Content from the Catalog
3130

3231
You can reference and include additional content from the Catalog using the **PackageContent/CatalogReferences.xml** file provided in this project.
33-
-->
32+
33+
1. Obtain an **Organization Key** from [admin.dataminer.services](https://admin.dataminer.services/) with the following scopes:
34+
- **Register catalog items**
35+
- **Read catalog items**
36+
- **Download catalog versions**
37+
38+
1. Securely store the key using Visual Studio User Secrets:
39+
40+
1. Right-click the project and select **Manage User Secrets**.
41+
42+
1. Add the key in the following format:
43+
44+
```json
45+
{
46+
"skyline": {
47+
"sdk": {
48+
"dataminertoken": "MyKeyHere"
49+
}
50+
}
51+
}
52+
```
3453

3554
### Importing from DataMiner
3655

@@ -81,8 +100,9 @@ You can publish your artifact manually through Visual Studio or by setting up a
81100
### Manual Publishing
82101

83102
1. Obtain an **Organization Key** from [admin.dataminer.services](https://admin.dataminer.services/) with the following scopes:
84-
- **Register Catalog items**
85-
- **Read Catalog items**
103+
- **Register catalog items**
104+
- **Read catalog items**
105+
- **Download catalog versions**
86106

87107
1. Securely store the key using Visual Studio User Secrets:
88108

@@ -94,7 +114,7 @@ You can publish your artifact manually through Visual Studio or by setting up a
94114
{
95115
"skyline": {
96116
"sdk": {
97-
"catalogpublishtoken": "MyKeyHere"
117+
"dataminertoken": "MyKeyHere"
98118
}
99119
}
100120
}
@@ -141,16 +161,17 @@ Follow these steps to set it up:
141161
``` text
142162
Error: DATAMINER_TOKEN is not set. Release not possible!
143163
Please create or re-use an admin.dataminer.services token by visiting: https://admin.dataminer.services/.
144-
Navigate to the right Organization then go to Keys and create/find a key with permissions to Register Catalog Items.
164+
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.
145165
Copy the value of the token.
146166
Then set a DATAMINER_TOKEN secret in your repository settings: **Dynamic Link**
147167
```
148168

149169
You can use the links from the actual error to better address the next couple of steps.
150170

151171
1. Obtain an **Organization Key** from [admin.dataminer.services](https://admin.dataminer.services/) with the following scopes:
152-
- **Register Catalog items**
153-
- **Read Catalog items**
172+
- **Register catalog items**
173+
- **Read catalog items**
174+
- **Download catalog versions**
154175

155176
1. Add the key as a secret in your GitHub repository, by navigating to **Settings > Secrets and variables > Actions** and creating a secret named `DATAMINER_TOKEN`.
156177

@@ -191,16 +212,17 @@ You need a **SonarCloud Organization**. If you don’t have one, you can create
191212
``` text
192213
Error: DATAMINER_TOKEN is not set. Release not possible!
193214
Please create or re-use an admin.dataminer.services token by visiting: https://admin.dataminer.services/.
194-
Navigate to the right Organization then go to Keys and create/find a key with permissions to Register Catalog Items.
215+
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..
195216
Copy the value of the token.
196217
Then set a DATAMINER_TOKEN secret in your repository settings: **Dynamic Link**
197218
```
198219

199220
You can use the links from the actual error to better address the next couple of steps.
200221

201222
1. Obtain an **Organization Key** from [admin.dataminer.services](https://admin.dataminer.services/) with the following scopes:
202-
- **Register Catalog items**
203-
- **Read Catalog items**
223+
- **Register catalog items**
224+
- **Read catalog items**
225+
- **Download catalog versions**
204226

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

@@ -210,7 +232,7 @@ The following secrets and variables will have been added to your repository afte
210232

211233
| Name | Type | Description | Setup Guide |
212234
|-----------------|---------|----------------------------------------------------|---------------------------------------------------------------------------------------------|
213-
| `DATAMINER_TOKEN` | Secret | Organization key for publishing to the Catalog | Obtain from [admin.dataminer.services](https://admin.dataminer.services/) and add it as a secret. |
235+
| `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. |
214236
| `SONAR_TOKEN` | Secret | Token for SonarCloud authentication | Obtain from [SonarCloud Security](https://sonarcloud.io/account/security) and add it as a secret. |
215237
| `SONAR_NAME` | Variable | SonarCloud project ID | Visit [SonarCloud](https://sonarcloud.io/projects/create), copy the project ID, and add it as a variable. |
216238

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
<CatalogReferences xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.skyline.be/catalogReferences">
2-
<!-- Currently not supported -->
2+
<!--
3+
<CatalogReference id="guid">
4+
<Name>Example Catalog Item (Specific Version)</Name>
5+
<Selection>
6+
<Specific>1.0.0.1</Specific>
7+
</Selection>
8+
</CatalogReference>
9+
<CatalogReference id="guid">
10+
<Name>Example Catalog Item (Range)</Name>
11+
<Selection>
12+
<Range>1.0.0</Range>
13+
</Selection>
14+
</CatalogReference>
15+
<CatalogReference id="guid">
16+
<Name>Example Catalog Item (Range - Prerelease)</Name>
17+
<Selection>
18+
<Range allowPrerelease="true">1.0.0</Range>
19+
</Selection>
20+
</CatalogReference>
21+
-->
322
</CatalogReferences>

working/templates/user-defined-api-project/$SCRIPTNAME$.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<Version>1.0.0</Version>
1111
<VersionComment>Initial Version</VersionComment>
1212
<!--#if (CreateDataMinerPackage)-->
13-
<!-- Do NOT fill in the Organization Token here. This points to either an Environment Variable skyline__sdk__catalogpublishtoken holding the organization token or a Visual Studio User Secret holding the token. -->
14-
<CatalogPublishKeyName>skyline:sdk:catalogpublishtoken</CatalogPublishKeyName>
13+
<!-- Do NOT fill in the Organization Token here. This points to either an Environment Variable skyline__sdk__dataminertoken holding the organization token or a Visual Studio User Secret holding the token. -->
14+
<CatalogPublishKeyName>skyline:sdk:dataminertoken</CatalogPublishKeyName>
1515
<!--#endif-->
1616
</PropertyGroup>
1717
<ItemGroup>

0 commit comments

Comments
 (0)