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
25 changes: 25 additions & 0 deletions .github/workflows/release-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release Github Pages

on:
push:
branches:
- main

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Configure Git Credentials
run: |-
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- uses: actions/setup-python@v6
- uses: abatilo/actions-poetry@v3
- name: Build and deploy the mkdocs site
run: |-
poetry install --no-root
poetry run mkdocs gh-deploy --force
19 changes: 19 additions & 0 deletions .github/workflows/test-mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test code and mkdocs build

on:
push:
branches-ignore:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: pre-commit/action@v3.0.1
- uses: abatilo/actions-poetry@v3
- name: Build the mkdocs site
run: |-
poetry install --no-root
poetry run mkdocs build
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ cython_debug/
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/

Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# documentation
How to use and develop the DB Operator
# DB Operator Documentation

## How to develop

### With poetry

1. Install poetry: <https://python-poetry.org/docs>
2. Run `poetry install --no-root`
3. Run `poetry run mkdocs serve`

### Pre commit hook

It's not required to use the `pre-commit` hooks, cause they will run anyway during `CI`, but if you want to see the issues before pushing, it's recommended to set it up. Please find more info here: <https://pre-commit.com/>
28 changes: 28 additions & 0 deletions docs/development/helm-charts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Helm Chart development

The repository where the helm charts are being developed can be found here: <https://github.com/db-operator/charts>

## Tools

Tools that are used for development:

- helm: <https://helm.sh>
- helmfile (used for testing): <https://helmfile.readthedocs.io/en/latest/>
- helm-unittest: <https://github.com/helm-unittest/helm-unittest>
- chart-testing: <https://github.com/helm/chart-testing>
- helm-docs: <https://github.com/norwoodj/helm-docs>
- pre-commit: <https://pre-commit.com>

## CRD management

In our case it seemed like a good idea to install CRDs using the helm templates, as the db-operator chart itself doesn't depend on them. In order not to maintain them by hands, we've written a script `./scripts/sync_crds.sh`, that is getting a desired version from the db-operator's `Chart.yaml` and syncs CRDs from the operator repository.

Let's say you have changed something in CRDs and want to test your change with the helm chart before the change is merged in the operator repository.

```shell
yq -i '.appVersion = "${GIT_SHA}"' ./charts/db-operator/Chart.yaml
./scripts/sync_crds.sh
```

After that, CRDs will be up-to-date with the operator repo and you can test your changes.
##
9 changes: 9 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Getting Started



## Install db-operator

## Create a DbInstance

## Create a Database
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
site_name: DB Operator
theme:
name: material
language: en
776 changes: 776 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[project]
name = "documentation"
version = "0.1.0"
description = "Mkdocs site about the db-operator"
authors = [
{name = "Nikolai Rodionov",email = "allanger@badhouseplants.net"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"mkdocs (>=1.6.1,<2.0.0)",
"mkdocs-material (>=9.7.1,<10.0.0)"
]


[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
Loading