Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 20 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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/);
Expand All @@ -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,
Expand All @@ -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, <platform>, <module-name>, 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);
Expand Down
2 changes: 1 addition & 1 deletion modules/aks/github-connector/buildingblock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion modules/aks/postgresql/buildingblock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion modules/aws/s3_bucket/buildingblock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/budget-alert/buildingblock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/key-vault/buildingblock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion modules/azure/key-vault/buildingblock/key-vault.svg

This file was deleted.

Binary file added modules/azure/key-vault/buildingblock/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion modules/azure/postgresql/buildingblock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/github/repository/buildingblock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions modules/github/repository/buildingblock/git-repo.svg

This file was deleted.

Binary file added modules/github/repository/buildingblock/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion website/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"cli": {
"schematicCollections": [
"@angular-eslint/schematics"
]
],
"analytics": false
}
}
Binary file not shown.
Binary file not shown.
2 changes: 0 additions & 2 deletions website/public/assets/building-block-logos/git-repo.svg

This file was deleted.

Binary file not shown.
1 change: 0 additions & 1 deletion website/public/assets/building-block-logos/key-vault.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
42 changes: 21 additions & 21 deletions website/public/assets/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down
Loading