diff --git a/README.md b/README.md index eb2c03f..2588fdb 100644 --- a/README.md +++ b/README.md @@ -26,14 +26,17 @@ A single module is structured as follows: ``` module_name/ - building_block/ -- This is the *actual* Terraform module that provisions resources. + buildingblock/ -- This is the *actual* Terraform module that provisions resources for application teams. main.tf provider.tf outputs.tf variables.tf + README.md -- This explains the module and how to use it from a platform engineering perspective. + APP_TEAM_README.md -- This explains the module and how to use it from an application team perspective. + logo.png -- This is the logo that is shown in the meshStack Hub and in the meshStack UI (if imported). backplane/ -- This is the Terraform code that provisions all supporting resources such as roles & techical users. <... Terraform files ...> - README.md -- This describes the module and how to use it. + README.md -- This explains the backplane module and how to use it. (optional) ``` ## 🔧 Usage diff --git a/index.ts b/index.ts index 43e9fc1..a232675 100644 --- a/index.ts +++ b/index.ts @@ -95,8 +95,9 @@ function findBuildingBlockLogo(buildingBlockDir) { files.forEach((file) => { if (file.endsWith(".png") || file.endsWith(".svg")) { + const { id, platform } = getIdAndPlatform(buildingBlockDir); const sourcePath = path.join(buildingBlockDir, file); - const destinationPath = path.join(assetsDir, path.basename(file)); + const destinationPath = path.join(assetsDir, `${id}${path.extname(file)}`); fs.mkdirSync(assetsDir, { recursive: true }); fs.copyFileSync(sourcePath, destinationPath); @@ -112,12 +113,10 @@ function findBuildingBlockLogo(buildingBlockDir) { * Parse README.md and extract relevant data */ function parseReadme(filePath) { + const buildingBlockDir = path.dirname(filePath); const content = fs.readFileSync(filePath, "utf-8"); const { data, content: body } = matter(content); - const relativePath = filePath.replace(process.cwd(), "").replace(/\\/g, "/"); - const pathParts = relativePath.split(path.sep).filter(Boolean); - const id = pathParts.slice(1, pathParts.length - 2).join("-"); - const platform = pathParts.length > 1 ? pathParts[1] : "unknown"; + const { id, platform } = getIdAndPlatform(buildingBlockDir); const howToMatch = body.match(/## How to Use([\s\S]*?)(##|$)/); const resourcesMatch = body.match(/## Resources([\s\S]*)/); const inputsMatch = body.match(/## Inputs([\s\S]*?)## Outputs/); @@ -141,7 +140,7 @@ function parseReadme(filePath) { console.log(`🔗 GitHub remote URLs: ${JSON.stringify(githubUrls)}`); console.log(`🔗 File path: ${filePath}`); - const buildingBlockLogoPath = findBuildingBlockLogo(path.dirname(filePath)); + const buildingBlockLogoPath = findBuildingBlockLogo(buildingBlockDir); return { id: id, @@ -156,6 +155,21 @@ function parseReadme(filePath) { }; } +/** + * This returns the id and platform type from the file path. + * + * @param filePath The buildingblock directory + */ +function getIdAndPlatform(filePath) { + const relativePath = filePath.replace(process.cwd(), "").replace(/\\/g, "/"); + const pathParts = relativePath.split(path.sep).filter(Boolean); + // pathParts = [modules, , , buildingblock] + const id = pathParts.slice(1, pathParts.length - 1).join("-"); + const platform = pathParts.length > 1 ? pathParts[1] : "unknown"; + + return { id, platform }; +} + const repoRoot = path.resolve(__dirname, 'modules'); const platformLogos = findPlatformLogos(); const readmeFiles = findReadmes(repoRoot); diff --git a/modules/aks/github-connector/bb_description.md b/modules/aks/github-connector/buildingblock/APP_TEAM_README.md similarity index 100% rename from modules/aks/github-connector/bb_description.md rename to modules/aks/github-connector/buildingblock/APP_TEAM_README.md diff --git a/modules/aks/github-connector/buildingblock/README.md b/modules/aks/github-connector/buildingblock/README.md index f15d341..821141e 100644 --- a/modules/aks/github-connector/buildingblock/README.md +++ b/modules/aks/github-connector/buildingblock/README.md @@ -3,7 +3,7 @@ name: GitHub Actions Integration with AKS supportedPlatforms: - aks description: | - 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. + CI/CD pipeline using GitHub Actions for secure, scalable AKS deployment. --- # GitHub Actions Integration with AKS diff --git a/modules/aks/github-connector/buildingblock/gc-aks.png b/modules/aks/github-connector/buildingblock/gc-aks.png deleted file mode 100644 index dde61b8..0000000 Binary files a/modules/aks/github-connector/buildingblock/gc-aks.png and /dev/null differ diff --git a/modules/aks/github-connector/buildingblock/logo.png b/modules/aks/github-connector/buildingblock/logo.png new file mode 100644 index 0000000..47f4f62 Binary files /dev/null and b/modules/aks/github-connector/buildingblock/logo.png differ diff --git a/modules/aks/postgresql/bb_description.md b/modules/aks/postgresql/buildingblock/APP_TEAM_README.md similarity index 100% rename from modules/aks/postgresql/bb_description.md rename to modules/aks/postgresql/buildingblock/APP_TEAM_README.md diff --git a/modules/aks/postgresql/buildingblock/README.md b/modules/aks/postgresql/buildingblock/README.md index 8a3f6bc..231b71a 100644 --- a/modules/aks/postgresql/buildingblock/README.md +++ b/modules/aks/postgresql/buildingblock/README.md @@ -3,7 +3,7 @@ name: PostgreSQL Integration with AKS supportedPlatforms: - aks description: | - 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. + Provides managed PostgreSQL with direct integration to AKS for secure access. --- # Postgresql Integration with AKS diff --git a/modules/aks/postgresql/buildingblock/postgressql-aks.png b/modules/aks/postgresql/buildingblock/logo.png similarity index 100% rename from modules/aks/postgresql/buildingblock/postgressql-aks.png rename to modules/aks/postgresql/buildingblock/logo.png diff --git a/modules/aks/postgresql/buildingblock/postgresql_logo.png b/modules/aks/postgresql/buildingblock/postgresql_logo.png deleted file mode 100644 index d2b838b..0000000 Binary files a/modules/aks/postgresql/buildingblock/postgresql_logo.png and /dev/null differ diff --git a/modules/aws/s3_bucket/bb_description.md b/modules/aws/s3_bucket/buildingblock/APP_TEAM_README.md similarity index 100% rename from modules/aws/s3_bucket/bb_description.md rename to modules/aws/s3_bucket/buildingblock/APP_TEAM_README.md diff --git a/modules/aws/s3_bucket/buildingblock/README.md b/modules/aws/s3_bucket/buildingblock/README.md index 8a79214..84cc410 100644 --- a/modules/aws/s3_bucket/buildingblock/README.md +++ b/modules/aws/s3_bucket/buildingblock/README.md @@ -3,7 +3,7 @@ name: AWS S3 Bucket supportedPlatforms: - aws description: | - Provides an AWS S3 bucket for object storage. It enables application teams to store and retrieve data securely with configurable access controls, lifecycle policies, and encryption. + Provides an AWS S3 bucket for object storage with access controls, lifecycle policies, and encryption. --- # AWS S3 Bucket diff --git a/modules/aws/s3_bucket/buildingblock/s3_bucket.png b/modules/aws/s3_bucket/buildingblock/logo.png similarity index 100% rename from modules/aws/s3_bucket/buildingblock/s3_bucket.png rename to modules/aws/s3_bucket/buildingblock/logo.png diff --git a/modules/azure/budget-alert/buildingblock/bb_description.md b/modules/azure/budget-alert/buildingblock/APP_TEAM_README.md similarity index 100% rename from modules/azure/budget-alert/buildingblock/bb_description.md rename to modules/azure/budget-alert/buildingblock/APP_TEAM_README.md diff --git a/modules/azure/budget-alert/buildingblock/README.md b/modules/azure/budget-alert/buildingblock/README.md index beaf461..2367d80 100644 --- a/modules/azure/budget-alert/buildingblock/README.md +++ b/modules/azure/budget-alert/buildingblock/README.md @@ -3,7 +3,7 @@ name: Azure Subscription Budget Alert supportedPlatforms: - azure description: | - Provides a budget alert for an Azure subscription. This module helps teams monitor cloud spending and avoid unexpected cost overruns by setting up automated budget alerts. + Sets up budget alerts for an Azure subscription to monitor spending and prevent cost overruns. --- # Azure Subscription Budget Alert diff --git a/modules/azure/budget-alert/buildingblock/budget_logo.png b/modules/azure/budget-alert/buildingblock/logo.png similarity index 100% rename from modules/azure/budget-alert/buildingblock/budget_logo.png rename to modules/azure/budget-alert/buildingblock/logo.png diff --git a/modules/azure/key-vault/bb_description.md b/modules/azure/key-vault/buildingblock/APP_TEAM_README.md similarity index 100% rename from modules/azure/key-vault/bb_description.md rename to modules/azure/key-vault/buildingblock/APP_TEAM_README.md diff --git a/modules/azure/key-vault/buildingblock/README.md b/modules/azure/key-vault/buildingblock/README.md index 51415ca..7d4e444 100644 --- a/modules/azure/key-vault/buildingblock/README.md +++ b/modules/azure/key-vault/buildingblock/README.md @@ -3,7 +3,7 @@ name: Azure Key Vault supportedPlatforms: - azure description: | - Provides an Azure Key Vault for secure storage and management of secrets, keys, and certificates. It helps application teams protect sensitive data, manage access control, and integrate securely with their applications. + Provides an Azure Key Vault to securely store and manage secrets, keys, and certificates with access control. --- # Azure Key Vault diff --git a/modules/azure/key-vault/buildingblock/key-vault.svg b/modules/azure/key-vault/buildingblock/key-vault.svg deleted file mode 100644 index 53f0135..0000000 --- a/modules/azure/key-vault/buildingblock/key-vault.svg +++ /dev/null @@ -1 +0,0 @@ -Icon-security-245 \ No newline at end of file diff --git a/modules/azure/key-vault/buildingblock/logo.png b/modules/azure/key-vault/buildingblock/logo.png new file mode 100644 index 0000000..9ee9c2b Binary files /dev/null and b/modules/azure/key-vault/buildingblock/logo.png differ diff --git a/modules/azure/postgresql/buildingblock/README.md b/modules/azure/postgresql/buildingblock/README.md index d4f5177..a8fb84b 100644 --- a/modules/azure/postgresql/buildingblock/README.md +++ b/modules/azure/postgresql/buildingblock/README.md @@ -3,7 +3,7 @@ name: Azure PostgreSQL Deployment supportedPlatforms: - azure description: | - Provides an Azure Database for PostgreSQL instance, offering a fully managed, scalable, and secure relational database service. It supports enterprise-grade PostgreSQL workloads with automated maintenance, high availability, and built-in security features. + Provides a managed Azure PostgreSQL database with scalability, security, and high availability. --- # Azure PostgreSQL Deployment diff --git a/modules/azure/postgresql/buildingblock/postgres_logo.png b/modules/azure/postgresql/buildingblock/logo.png similarity index 100% rename from modules/azure/postgresql/buildingblock/postgres_logo.png rename to modules/azure/postgresql/buildingblock/logo.png diff --git a/modules/github/repository/bb_description.md b/modules/github/repository/buildingblock/APP_TEAM_README.md similarity index 100% rename from modules/github/repository/bb_description.md rename to modules/github/repository/buildingblock/APP_TEAM_README.md diff --git a/modules/github/repository/buildingblock/README.md b/modules/github/repository/buildingblock/README.md index 602582a..fdde9ab 100644 --- a/modules/github/repository/buildingblock/README.md +++ b/modules/github/repository/buildingblock/README.md @@ -3,7 +3,7 @@ name: GitHub Repository Creation supportedPlatforms: - github description: | - Provides an automated way to create and manage GitHub repositories for application teams. It ensures repositories are set up with predefined configurations, including access control, branch protection rules, and compliance settings. + Automates GitHub repository setup with predefined configurations and access control. --- # GitHub Repository Building Block diff --git a/modules/github/repository/buildingblock/git-repo.svg b/modules/github/repository/buildingblock/git-repo.svg deleted file mode 100644 index 0226b12..0000000 --- a/modules/github/repository/buildingblock/git-repo.svg +++ /dev/null @@ -1,2 +0,0 @@ - -Git icon \ No newline at end of file diff --git a/modules/github/repository/buildingblock/logo.png b/modules/github/repository/buildingblock/logo.png new file mode 100644 index 0000000..94777fd Binary files /dev/null and b/modules/github/repository/buildingblock/logo.png differ diff --git a/website/angular.json b/website/angular.json index 5cee39f..f89e586 100644 --- a/website/angular.json +++ b/website/angular.json @@ -118,6 +118,7 @@ "cli": { "schematicCollections": [ "@angular-eslint/schematics" - ] + ], + "analytics": false } } \ No newline at end of file diff --git a/website/public/assets/building-block-logos/budget_logo.png b/website/public/assets/building-block-logos/budget_logo.png deleted file mode 100644 index e7489ca..0000000 Binary files a/website/public/assets/building-block-logos/budget_logo.png and /dev/null differ diff --git a/website/public/assets/building-block-logos/gc-aks.png b/website/public/assets/building-block-logos/gc-aks.png deleted file mode 100644 index dde61b8..0000000 Binary files a/website/public/assets/building-block-logos/gc-aks.png and /dev/null differ diff --git a/website/public/assets/building-block-logos/git-repo.svg b/website/public/assets/building-block-logos/git-repo.svg deleted file mode 100644 index 0226b12..0000000 --- a/website/public/assets/building-block-logos/git-repo.svg +++ /dev/null @@ -1,2 +0,0 @@ - -Git icon \ No newline at end of file diff --git a/website/public/assets/building-block-logos/github_logo.png b/website/public/assets/building-block-logos/github_logo.png deleted file mode 100644 index c17d62c..0000000 Binary files a/website/public/assets/building-block-logos/github_logo.png and /dev/null differ diff --git a/website/public/assets/building-block-logos/key-vault.svg b/website/public/assets/building-block-logos/key-vault.svg deleted file mode 100644 index 53f0135..0000000 --- a/website/public/assets/building-block-logos/key-vault.svg +++ /dev/null @@ -1 +0,0 @@ -Icon-security-245 \ No newline at end of file diff --git a/website/public/assets/building-block-logos/key_vault_logo.png b/website/public/assets/building-block-logos/key_vault_logo.png deleted file mode 100644 index 47500a1..0000000 Binary files a/website/public/assets/building-block-logos/key_vault_logo.png and /dev/null differ diff --git a/website/public/assets/building-block-logos/postgres_logo.png b/website/public/assets/building-block-logos/postgres_logo.png deleted file mode 100644 index be52c23..0000000 Binary files a/website/public/assets/building-block-logos/postgres_logo.png and /dev/null differ diff --git a/website/public/assets/building-block-logos/postgresql_logo.png b/website/public/assets/building-block-logos/postgresql_logo.png deleted file mode 100644 index d2b838b..0000000 Binary files a/website/public/assets/building-block-logos/postgresql_logo.png and /dev/null differ diff --git a/website/public/assets/building-block-logos/postgressql-aks.png b/website/public/assets/building-block-logos/postgressql-aks.png deleted file mode 100644 index b360079..0000000 Binary files a/website/public/assets/building-block-logos/postgressql-aks.png and /dev/null differ diff --git a/website/public/assets/building-block-logos/s3_bucket.png b/website/public/assets/building-block-logos/s3_bucket.png deleted file mode 100644 index e31ad96..0000000 Binary files a/website/public/assets/building-block-logos/s3_bucket.png and /dev/null differ diff --git a/website/public/assets/templates.json b/website/public/assets/templates.json index 4d29d27..41db5fd 100644 --- a/website/public/assets/templates.json +++ b/website/public/assets/templates.json @@ -3,16 +3,16 @@ { "id": "aks-github-connector", "platformType": "aks", - "logo": "assets/building-block-logos/gc-aks.png", + "logo": "assets/building-block-logos/aks-github-connector.png", "githubUrls": { - "ssh": "https://github.com/meshcloud/meshstack-hub.git", + "ssh": "git@github.com:meshcloud/meshstack-hub.git", "https": "https://github.com/meshcloud/meshstack-hub/tree/main/modules/aks/github-connector/buildingblock" }, "name": "GitHub Actions Integration with AKS", "supportedPlatforms": [ "aks" ], - "description": "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.\n", + "description": "CI/CD pipeline using GitHub Actions for secure, scalable AKS deployment.\n", "howToUse": null, "resources": [ { @@ -47,16 +47,16 @@ { "id": "aks-postgresql", "platformType": "aks", - "logo": "assets/building-block-logos/postgresql_logo.png", + "logo": "assets/building-block-logos/aks-postgresql.png", "githubUrls": { - "ssh": "https://github.com/meshcloud/meshstack-hub.git", + "ssh": "git@github.com:meshcloud/meshstack-hub.git", "https": "https://github.com/meshcloud/meshstack-hub/tree/main/modules/aks/postgresql/buildingblock" }, "name": "PostgreSQL Integration with AKS", "supportedPlatforms": [ "aks" ], - "description": "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.\n", + "description": "Provides managed PostgreSQL with direct integration to AKS for secure access.\n", "howToUse": null, "resources": [ { @@ -128,16 +128,16 @@ { "id": "aws-s3_bucket", "platformType": "aws", - "logo": "assets/building-block-logos/s3_bucket.png", + "logo": "assets/building-block-logos/aws-s3_bucket.png", "githubUrls": { - "ssh": "https://github.com/meshcloud/meshstack-hub.git", + "ssh": "git@github.com:meshcloud/meshstack-hub.git", "https": "https://github.com/meshcloud/meshstack-hub/tree/main/modules/aws/s3_bucket/buildingblock" }, "name": "AWS S3 Bucket", "supportedPlatforms": [ "aws" ], - "description": "Provides an AWS S3 bucket for object storage. It enables application teams to store and retrieve data securely with configurable access controls, lifecycle policies, and encryption.\n", + "description": "Provides an AWS S3 bucket for object storage with access controls, lifecycle policies, and encryption.\n", "howToUse": null, "resources": [ { @@ -233,16 +233,16 @@ { "id": "azure-budget-alert", "platformType": "azure", - "logo": "assets/building-block-logos/budget_logo.png", + "logo": "assets/building-block-logos/azure-budget-alert.png", "githubUrls": { - "ssh": "https://github.com/meshcloud/meshstack-hub.git", + "ssh": "git@github.com:meshcloud/meshstack-hub.git", "https": "https://github.com/meshcloud/meshstack-hub/tree/main/modules/azure/budget-alert/buildingblock" }, "name": "Azure Subscription Budget Alert", "supportedPlatforms": [ "azure" ], - "description": "Provides a budget alert for an Azure subscription. This module helps teams monitor cloud spending and avoid unexpected cost overruns by setting up automated budget alerts.\n", + "description": "Sets up budget alerts for an Azure subscription to monitor spending and prevent cost overruns.\n", "howToUse": null, "resources": [ { @@ -338,16 +338,16 @@ { "id": "azure-key-vault", "platformType": "azure", - "logo": "assets/building-block-logos/key-vault.svg", + "logo": "assets/building-block-logos/azure-key-vault.png", "githubUrls": { - "ssh": "https://github.com/meshcloud/meshstack-hub.git", + "ssh": "git@github.com:meshcloud/meshstack-hub.git", "https": "https://github.com/meshcloud/meshstack-hub/tree/main/modules/azure/key-vault/buildingblock" }, "name": "Azure Key Vault", "supportedPlatforms": [ "azure" ], - "description": "Provides an Azure Key Vault for secure storage and management of secrets, keys, and certificates. It helps application teams protect sensitive data, manage access control, and integrate securely with their applications.\n", + "description": "Provides an Azure Key Vault to securely store and manage secrets, keys, and certificates with access control.\n", "howToUse": null, "resources": [ { @@ -467,16 +467,16 @@ { "id": "azure-postgresql", "platformType": "azure", - "logo": "assets/building-block-logos/postgres_logo.png", + "logo": "assets/building-block-logos/azure-postgresql.png", "githubUrls": { - "ssh": "https://github.com/meshcloud/meshstack-hub.git", + "ssh": "git@github.com:meshcloud/meshstack-hub.git", "https": "https://github.com/meshcloud/meshstack-hub/tree/main/modules/azure/postgresql/buildingblock" }, "name": "Azure PostgreSQL Deployment", "supportedPlatforms": [ "azure" ], - "description": "Provides an Azure Database for PostgreSQL instance, offering a fully managed, scalable, and secure relational database service. It supports enterprise-grade PostgreSQL workloads with automated maintenance, high availability, and built-in security features.\n", + "description": "Provides a managed Azure PostgreSQL database with scalability, security, and high availability.\n", "howToUse": null, "resources": [ { @@ -728,16 +728,16 @@ { "id": "github-repository", "platformType": "github", - "logo": "assets/building-block-logos/git-repo.svg", + "logo": "assets/building-block-logos/github-repository.png", "githubUrls": { - "ssh": "https://github.com/meshcloud/meshstack-hub.git", + "ssh": "git@github.com:meshcloud/meshstack-hub.git", "https": "https://github.com/meshcloud/meshstack-hub/tree/main/modules/github/repository/buildingblock" }, "name": "GitHub Repository Creation", "supportedPlatforms": [ "github" ], - "description": "Provides an automated way to create and manage GitHub repositories for application teams. It ensures repositories are set up with predefined configurations, including access control, branch protection rules, and compliance settings.\n", + "description": "Automates GitHub repository setup with predefined configurations and access control.\n", "howToUse": null, "resources": [ {