-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from oldgiova/QA-820-os-licenses-split
License publication automation
- Loading branch information
Showing
5 changed files
with
131 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: Mender Server | ||
taxonomy: | ||
category: docs | ||
shortcode-core: | ||
active: false | ||
--- | ||
|
||
All open source licenses used in Mender Server with the default build are shown below. | ||
|
||
Where copyright holder is missing, please refer to the repository of the software to identify the copyright holder(s). | ||
|
||
Third party licenses used in Mender Server: this file is autogenerated with `go list`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { join } from 'jsr:@std/path'; | ||
|
||
import { rootDir } from './common.js'; | ||
|
||
type License = { | ||
name: string; | ||
version: string; | ||
author?: string; | ||
repository: string; | ||
source: string; | ||
license: string; | ||
licenseText: string; | ||
}; | ||
|
||
const formatLicenseEntry = (licenseRecord: License) => { | ||
const { name, version, repository, license, licenseText } = licenseRecord; | ||
return `## ${name}\n | ||
* Name: ${name} | ||
* Version: ${version} | ||
* License: [${license}](${repository})\n | ||
\`\`\`\n${licenseText}\`\`\`\n`; | ||
}; | ||
|
||
const processLicenseFile = async () => { | ||
const root = rootDir ?? '.'; | ||
const { default: licenses } = await import(join(root, 'frontend', 'licenses.json'), { | ||
with: { type: 'json' } | ||
}); | ||
const licenseEntries = licenses.map(formatLicenseEntry).join('\n'); | ||
await Deno.writeTextFile(join(root, 'frontend', 'licenses.md'), `# Licenses\n\n\n${licenseEntries}`); | ||
}; | ||
|
||
await processLicenseFile(); |