Skip to content

Commit e51ce28

Browse files
authored
Merge pull request #17 from meshcloud/feature/fix-and-improvement
Feature/fix and improvement
2 parents 42a9bc3 + 35128ae commit e51ce28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+304
-132
lines changed

index.ts

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ function convertGitToHttpUrl(gitUrl) {
1616
/**
1717
* Get GitHub remote URLs in HTTP and SSH format
1818
*/
19-
function getGithubRemoteUrls() {
19+
function getGithubRemoteUrls(filePath) {
2020
try {
2121
const remoteUrl = execSync("git config --get remote.origin.url").toString().trim().replace(/https?:\/\/.*?@github\.com\//, "https://github.com/");
22-
const httpUrl = convertGitToHttpUrl(remoteUrl);
22+
const httpUrl = convertGitToHttpUrl(remoteUrl).replace(
23+
/\.git$/,
24+
`/tree/main/modules${filePath.replace(path.resolve(__dirname, 'modules'), '').replace(/\/README\.md$/, '')}`
25+
);
2326
return {
2427
ssh: remoteUrl,
2528
https: httpUrl
@@ -66,9 +69,9 @@ function findPlatformLogos() {
6669
const files = fs.readdirSync(platformDir);
6770

6871
files.forEach((file) => {
69-
if (file.endsWith(".png")) {
72+
if (file.endsWith(".png") || file.endsWith(".svg")) {
7073
const sourcePath = path.join(platformDir, file);
71-
const destinationPath = path.join(assetsDir, dir.name + ".png");
74+
const destinationPath = path.join(assetsDir, `${dir.name}${path.extname(file)}`);
7275

7376
fs.mkdirSync(assetsDir, { recursive: true });
7477

@@ -91,7 +94,7 @@ function findBuildingBlockLogo(buildingBlockDir) {
9194
const files = fs.readdirSync(buildingBlockDir);
9295

9396
files.forEach((file) => {
94-
if (file.endsWith(".png")) {
97+
if (file.endsWith(".png") || file.endsWith(".svg")) {
9598
const sourcePath = path.join(buildingBlockDir, file);
9699
const destinationPath = path.join(assetsDir, path.basename(file));
97100

@@ -123,18 +126,21 @@ function parseReadme(filePath) {
123126
const parseTable = (match) =>
124127
match
125128
? match[1]
126-
.split("\n")
127-
.filter((line) => line.startsWith("| <a name"))
128-
.map((line) => line.split("|").map((s) => s.trim()))
129-
.map(([name, description, type, _default, required]) => ({
130-
name: name.replace(/<a name=".*?_(.*?)".*?>/, "$1"),
131-
description,
132-
type,
133-
required: required === "yes",
134-
}))
129+
.split("\n")
130+
.filter((line) => line.startsWith("| <a name"))
131+
.map((line) => line.split("|").map((s) => s.trim()))
132+
.map(([name, description, type, _default, required]) => ({
133+
name: name.replace(/<a name=".*?_(.*?)".*?>/, "$1"),
134+
description,
135+
type,
136+
required: required === "yes",
137+
}))
135138
: [];
136139

137-
const githubUrls = getGithubRemoteUrls();
140+
const githubUrls = getGithubRemoteUrls(filePath);
141+
console.log(`🔗 GitHub remote URLs: ${JSON.stringify(githubUrls)}`);
142+
console.log(`🔗 File path: ${filePath}`);
143+
138144
const buildingBlockLogoPath = findBuildingBlockLogo(path.dirname(filePath));
139145

140146
return {

modules/aks/aks.svg

Lines changed: 1 addition & 0 deletions
Loading

modules/aks/aks_logo.png

-25.6 KB
Binary file not shown.

modules/aks/github-connector/buildingblock/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: GitHub Actions Integration with AKS
33
supportedPlatforms:
44
- aks
55
description: |
6-
Building block module for integrating GitHub Actions with Azure Kubernetes Service (AKS)
6+
Provides an automated CI/CD pipeline using GitHub Actions to deploy applications to Azure Kubernetes Service (AKS). It enables application teams to build, test, and deploy containerized applications seamlessly while following best practices for security and scalability.
77
---
88

99
# GitHub Actions Integration with AKS
135 KB
Loading
-53.7 KB
Binary file not shown.

modules/aks/postgresql/buildingblock/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
name: Postgresql Integration with AKS
2+
name: PostgreSQL Integration with AKS
33
supportedPlatforms:
44
- aks
55
description: |
6-
Building Block module for a Postgresql Instance integrated to Azure Kubernetes Service (AKS)
6+
Provides an Azure Database for PostgreSQL instance integrated with Azure Kubernetes Service (AKS). It enables application teams to use a fully managed PostgreSQL database while ensuring seamless connectivity and security with their AKS workloads.
77
---
88

99
# Postgresql Integration with AKS
76.8 KB
Loading

modules/aws/amazon_logo.png

-47.3 KB
Binary file not shown.

modules/aws/aws.svg

Lines changed: 38 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)