Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextra3 and some Scanner docs. #82

Merged
merged 5 commits into from
Sep 28, 2024
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
28 changes: 20 additions & 8 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Ctrlplane Docs

This is a [Next.js](https://nextjs.org/) project bootstrapped with
[`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

Expand All @@ -14,23 +17,32 @@ pnpm dev
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Open [http://localhost:3000](http://localhost:3000) with your browser to
see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
You can start editing the page by modifying `app/page.tsx`. The page
auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization)
to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/)

- your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
The easiest way to deploy your Next.js app is to use the
[Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme)
from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment)
for more details.
1 change: 0 additions & 1 deletion apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-ignore
import nextra from "nextra";

/** @type {import('next').NextConfig} */
Expand Down
14 changes: 8 additions & 6 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
"build": "next build",
"start": "next start -p 3001",
"lint": "eslint",
"build:docker": "docker build -f apps/docs/Dockerfile -t docs ."
"build:docker": "docker build -f apps/docs/Dockerfile -t docs .",
"format": "prettier --check . --ignore-path ../../.gitignore"
},
"dependencies": {
"@ctrlplane/ui": "workspace:*",
"next": "^14.2.3",
"nextra": "^2.13.4",
"nextra-theme-docs": "latest",
"next": "catalog:",
"nextra": "^3.0.0",
"nextra-theme-docs": "^3.0.0",
"react": "catalog:react18",
"react-dom": "catalog:react18",
"react-icons": "^5.2.1"
"react-icons": "^5.3.0"
},
"devDependencies": {
"@ctrlplane/eslint-config": "workspace:*",
Expand All @@ -33,5 +34,6 @@
"tailwindcss": "catalog:",
"typescript": "catalog:",
"typescript-eslint": "catalog:"
}
},
"prettier": "@ctrlplane/prettier-config"
}
9 changes: 0 additions & 9 deletions apps/docs/pages/_meta.json

This file was deleted.

9 changes: 9 additions & 0 deletions apps/docs/pages/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
index: "Home",
quickstart: "Quickstart",
"core-concepts": "Core Concepts",
integrations: "Integrations",
"self-hosted": "Self-hosted",
glossary: "Glossary",
troubleshooting: "Troubleshooting",
};
8 changes: 0 additions & 8 deletions apps/docs/pages/core-concepts/_meta.json

This file was deleted.

8 changes: 8 additions & 0 deletions apps/docs/pages/core-concepts/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
systems: "Systems",
targets: "Targets",
environments: "Environments",
deployments: "Deployments",
runbooks: "Runbooks",
jobs: "Jobs",
};
20 changes: 11 additions & 9 deletions apps/docs/pages/core-concepts/deployments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Deployments in Ctrlplane are the central organizing principle for managing and
orchestrating the release of your software or infrastructure across various
environments within a system. A deployment represents a complete, end-to-end process
for delivering changes to your system, encompassing everything from the initial
code commit to the final production release.
environments within a system. A deployment represents a complete, end-to-end
process for delivering changes to your system, encompassing everything from the
initial code commit to the final production release.

## What is a Deployment?

Expand All @@ -13,9 +13,10 @@ A deployment in Ctrlplane is:
1. **A Logical Unit**: It typically represents a single service, application, or
piece of infrastructure.

2. **System-Bound**: Each deployment is assigned to a specific system, which contains
multiple environments (e.g., QA, Staging, Production). When you create a deployment,
it automatically becomes part of all environments within that system.
2. **System-Bound**: Each deployment is assigned to a specific system, which
contains multiple environments (e.g., QA, Staging, Production). When you
create a deployment, it automatically becomes part of all environments within
that system.

3. **Version Control**: It manages multiple releases (versions) of your software
or infrastructure configuration.
Expand All @@ -42,8 +43,8 @@ A deployment in Ctrlplane typically includes:
4. **Job Configurations**: Specifications for the jobs that will be created and
run for each release and target.

5. **Variables**: Target-specific variables that allow the same pipeline to
be used across different environments.
5. **Variables**: Target-specific variables that allow the same pipeline to be
used across different environments.

## Systems, Environments, and Target Filtering

Expand Down Expand Up @@ -95,6 +96,7 @@ Deployments can be created and managed in two primary ways:

2. **Automated Creation**: By including a `.ctrlplane.yaml` file in your Git
repository. This method allows for automatic deployment creation when new
repositories are added, with system assignment specified in the configuration.
repositories are added, with system assignment specified in the
configuration.

Example `.ctrlplane.yaml`:
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"metadata": "Metadata",
export default {
metadata: "Metadata",
"target-providers": "Target Providers",
"managing-targets": "Managing Targets",
"schemas": "Schemas"
}
schemas: "Schemas",
};
7 changes: 4 additions & 3 deletions apps/docs/pages/core-concepts/targets/labels.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ selectively.

## Understanding Target Metadata

Metadata is attached to targets, allowing you to group and select
targets based on various criteria. They are particularly useful for:
Metadata is attached to targets, allowing you to group and select targets based
on various criteria. They are particularly useful for:

- Organizing targets by environment, region, or purpose
- Applying configurations to specific groups of targets
Expand All @@ -17,7 +17,8 @@ targets based on various criteria. They are particularly useful for:

## How Metadata Works in Ctrlplane

1. **Definition**: Metadata are defined as key-value pairs on individual targets.
1. **Definition**: Metadata are defined as key-value pairs on individual
targets.
2. **Flexibility**: You can assign multiple key-value pairs to a single target.
3. **Querying**: Ctrlplane allows you to query and filter targets based on their
metadata.
Expand Down
19 changes: 11 additions & 8 deletions apps/docs/pages/core-concepts/targets/managing-targets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Target Groups can be incredibly versatile. Here are some common use cases:
- Example metadata: `customer: acme-corp`, `business-size: enterprise`

5. **Service Type**: Group targets by the primary service they run.
- Example metadata: `service: web-server`, `service: database`, `service:
cache`
- Example metadata: `service: web-server`, `service: database`,
`service: cache`

### Benefits of Using Target Groups

Expand All @@ -72,10 +72,10 @@ cache`

1. **Consistent Metadata**: Develop and adhere to a consistent metadata strategy
across your organization.
2. **Meaningful Metadata**: Choose metadata keys that provide valuable information and
aid in practical grouping.
3. **Avoid Over-Complexity**: While metadata is powerful, too many keys can lead to
overly complex groupings. Aim for a balance.
2. **Meaningful Metadata**: Choose metadata keys that provide valuable
information and aid in practical grouping.
3. **Avoid Over-Complexity**: While metadata is powerful, too many keys can lead
to overly complex groupings. Aim for a balance.
4. **Regular Review**: Periodically review and update your metadata strategy as
your infrastructure evolves.

Expand Down Expand Up @@ -123,9 +123,12 @@ Once created, Target Views can be accessed from the Targets page. You can:
You can edit or delete existing views as your infrastructure evolves:

- To update a view, apply new filters and save over the existing view.
- To delete a view, select it and use the delete option in the view management interface.
- To delete a view, select it and use the delete option in the view management
interface.

Target Views are a valuable tool for maintaining organization and efficiency in your target management workflow, especially as your infrastructure grows in size and complexity.
Target Views are a valuable tool for maintaining organization and efficiency in
your target management workflow, especially as your infrastructure grows in size
and complexity.

## Locking Targets

Expand Down
44 changes: 21 additions & 23 deletions apps/docs/pages/core-concepts/targets/schemas.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Schemas

In Ctrlplane, schema registration for targets allows you to define
and enforce consistent structures for the configuration properties of your
targets. This ensures that all targets of a particular
kind adhere to a standardized schema, making it easier to manage and consume
these targets in your deployment pipelines.
In Ctrlplane, schema registration for targets allows you to define and enforce
consistent structures for the configuration properties of your targets. This
ensures that all targets of a particular kind adhere to a standardized schema,
making it easier to manage and consume these targets in your deployment
pipelines.

## Key Concepts

- **Kind:** The kind field represents the type of target (e.g., "EKS
Cluster," "Kubernetes Namespace," "Custom Target").
- **Kind:** The kind field represents the type of target (e.g., "EKS Cluster,"
"Kubernetes Namespace," "Custom Target").
- **Version:** The version field indicates the schema version, allowing for
backward compatibility as your schemas evolve (e.g., "kubernetes/v1",
"terraform/v2").
Expand All @@ -18,29 +18,27 @@ these targets in your deployment pipelines.

## Schema Structure

The schema for a target is a standard JSON Schema definition. It
outlines the required and optional properties, their data types, validation
rules, and any additional constraints. The schema is specifically applied to the
config section of your target.
The schema for a target is a standard JSON Schema definition. It outlines the
required and optional properties, their data types, validation rules, and any
additional constraints. The schema is specifically applied to the config section
of your target.

## Pre-built Schemas

Ctrlplane comes with a set of pre-built schemas for common target
types, saving you time and effort in defining your own. These schemas cover
widely used configurations, ensuring consistency and ease of use across
different projects.
Ctrlplane comes with a set of pre-built schemas for common target types, saving
you time and effort in defining your own. These schemas cover widely used
configurations, ensuring consistency and ease of use across different projects.

You can learn about all the builtin kinds [here](/docs/targets/schemas).

## Why Use Schema Registration?

Schema registration offers several benefits:

- **Consistency:** Enforces a uniform structure for targets of the
same kind, ensuring predictable configuration across your deployments.
- **Consistency:** Enforces a uniform structure for targets of the same kind,
ensuring predictable configuration across your deployments.
- **Validation:** Automatically validates the configuration of new or updated
targets against the registered schema, preventing errors and
inconsistencies.
targets against the registered schema, preventing errors and inconsistencies.
- **Documentation:** Provides a clear and structured definition of the expected
configuration, aiding collaboration and understanding among team members.
- **Versioning:** Allows for gradual evolution of your schemas without breaking
Expand All @@ -52,10 +50,10 @@ Schema registration offers several benefits:
config section for a specific kind and version of target.
- **Schema Registration:** Register the schema with Ctrlplane using the API or
UI.
- **Target Creation/Update:** When creating or updating a deployment
target, Ctrlplane automatically validates the config section against the
registered schema. If the configuration is invalid, an error is raised,
preventing the target from being created or updated.
- **Target Creation/Update:** When creating or updating a deployment target,
Ctrlplane automatically validates the config section against the registered
schema. If the configuration is invalid, an error is raised, preventing the
target from being created or updated.

## Best Practices

Expand Down
3 changes: 0 additions & 3 deletions apps/docs/pages/core-concepts/targets/schemas/_meta.json

This file was deleted.

3 changes: 3 additions & 0 deletions apps/docs/pages/core-concepts/targets/schemas/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
kubernetes: "kubernetes/v1",
};
Loading
Loading