Skip to content

Commit

Permalink
Merge pull request #93 from rafsaf/add-mike-and-docs-versioning
Browse files Browse the repository at this point in the history
Add mike and docs versioning, update link in main.py after this change
  • Loading branch information
rafsaf authored Aug 12, 2023
2 parents 96cc42f + 316f31b commit 649a2f2
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 73 deletions.
59 changes: 0 additions & 59 deletions .github/workflows/gh_pages_docs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion backuper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def shutdown() -> NoReturn:
deadline = start + timeout_secs
log.info(
"start backuper shutdown, force exit after SIGTERM_TIMEOUT_SECS=%ss, "
"use this environment to control it, see https://backuper.rafsaf.pl/configuration/.",
"use this environment to control it, see https://backuper.rafsaf.pl/latest/configuration/.",
timeout_secs,
)
for thread in threading.enumerate():
Expand Down
2 changes: 1 addition & 1 deletion docs/backup_targets/directory.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DIRECTORY_SOME_STRING="abs_path=... cron_rule=..."
| :---------- | :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------- |
| abs_path | string[**requried**] | Absolute path to folder for backup. | - |
| cron_rule | string[**requried**] | Cron expression for backups, see [https://crontab.guru/](https://crontab.guru/) for help. | - |
| max_backups | int | Max number of backups stored in upload provider, if this number is exceeded, oldest one is removed, by default enviornment variable BACKUP_MAX_NUMBER, see [Configuration](/configuration). | BACKUP_MAX_NUMBER |
| max_backups | int | Max number of backups stored in upload provider, if this number is exceeded, oldest one is removed, by default enviornment variable BACKUP_MAX_NUMBER, see [Configuration](./../configuration.md). | BACKUP_MAX_NUMBER |


## Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/backup_targets/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SINGLEFILE_SOME_STRING="abs_path=... cron_rule=..."
| :---------- | :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------- |
| abs_path | string[**requried**] | Absolute path to file for backup. | - |
| cron_rule | string[**requried**] | Cron expression for backups, see [https://crontab.guru/](https://crontab.guru/) for help. | - |
| max_backups | int | Max number of backups stored in upload provider, if this number is exceeded, oldest one is removed, by default enviornment variable BACKUP_MAX_NUMBER, see [Configuration](/configuration). | BACKUP_MAX_NUMBER |
| max_backups | int | Max number of backups stored in upload provider, if this number is exceeded, oldest one is removed, by default enviornment variable BACKUP_MAX_NUMBER, see [Configuration](./../configuration.md). | BACKUP_MAX_NUMBER |


## Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/backup_targets/mariadb.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MARIADB_SOME_STRING="host=... password=... cron_rule=..."
| host | string | Mariadb database hostname. | localhost |
| port | int | Mariadb database port. | 3306 |
| db | string | Mariadb database name. | mariadb |
| max_backups | int | Max number of backups stored in upload provider, if this number is exceeded, oldest one is removed, by default enviornment variable BACKUP_MAX_NUMBER, see [Configuration](/configuration). | BACKUP_MAX_NUMBER |
| max_backups | int | Max number of backups stored in upload provider, if this number is exceeded, oldest one is removed, by default enviornment variable BACKUP_MAX_NUMBER, see [Configuration](./../configuration.md). | BACKUP_MAX_NUMBER |


## Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/backup_targets/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MYSQL_SOME_STRING="host=... password=... cron_rule=..."
| host | string | MySQL database hostname. | localhost |
| port | int | MySQL database port. | 3306 |
| db | string | MySQL database name. | mysql |
| max_backups | int | Max number of backups stored in upload provider, if this number is exceeded, oldest one is removed, by default enviornment variable BACKUP_MAX_NUMBER, see [Configuration](/configuration). | BACKUP_MAX_NUMBER |
| max_backups | int | Max number of backups stored in upload provider, if this number is exceeded, oldest one is removed, by default enviornment variable BACKUP_MAX_NUMBER, see [Configuration](./../configuration.md). | BACKUP_MAX_NUMBER |


## Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/backup_targets/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ POSTGRESQL_SOME_STRING="host=... password=... cron_rule=..."
| host | string | PostgreSQL database hostname. | localhost |
| port | int | PostgreSQL database port. | 5432 |
| db | string | PostgreSQL database name. | postgres |
| max_backups | int | Max number of backups stored in upload provider, if this number is exceeded, oldest one is removed, by default enviornment variable BACKUP_MAX_NUMBER, see [Configuration](/configuration). | BACKUP_MAX_NUMBER |
| max_backups | int | Max number of backups stored in upload provider, if this number is exceeded, oldest one is removed, by default enviornment variable BACKUP_MAX_NUMBER, see [Configuration](./../configuration.md). | BACKUP_MAX_NUMBER |


## Examples
Expand Down
12 changes: 6 additions & 6 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Environemt variables
| Name | Type | Description | Default |
| :------------------------------- | :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------- |
| ZIP_ARCHIVE_PASSWORD | string[**required**] | Zip archive password that all backups generated by this backuper instance will have. When it is lost, you lose access to your backups. | - |
| BACKUP_PROVIDER | string[**required**] | See `Providers` chapter, choosen backup provider for example [GCS](/providers/google_cloud_storage). | - |
| BACKUP_PROVIDER | string[**required**] | See `Providers` chapter, choosen backup provider for example [GCS](./providers/google_cloud_storage.md). | - |
| BACKUP_MAX_NUMBER | int | How many backups can live at once for backup target. Defaults to `7`. Note this must makes sense with cron expression you use. For example if you want to have 7 day retention, and make backups at 5:00, BACKUP_MAX_NUMBER=7 is fine, but if you make 4 backups per day, you will need BACKUP_MAX_NUMBER=28. | 7 |
| POSTGRESQL\_... | backup target syntax | PostgreSQL database target, see [PostgreSQL](/backup_targets/postgresql/). | - |
| MYSQL\_... | backup target syntax | MySQL database target, see [MySQL](/backup_targets/mysql). | - |
| MARIADB\_... | backup target syntax | MariaDB database target, see [MariaDB](/backup_targets/mariadb). | - |
| SINGLEFILE\_... | backup target syntax | Single file database target, see [Single file](/backup_targets/file). | - |
| DIRECTORY\_... | backup target syntax | Directory database target, see [Directory](/backup_targets/directory). | - |
| POSTGRESQL\_... | backup target syntax | PostgreSQL database target, see [PostgreSQL](./backup_targets/postgresql.md). | - |
| MYSQL\_... | backup target syntax | MySQL database target, see [MySQL](./backup_targets/mysql.md). | - |
| MARIADB\_... | backup target syntax | MariaDB database target, see [MariaDB](./backup_targets/mariadb.md). | - |
| SINGLEFILE\_... | backup target syntax | Single file database target, see [Single file](./backup_targets/file.md). | - |
| DIRECTORY\_... | backup target syntax | Directory database target, see [Directory](backup_targets/directory.md). | - |
| DISCORD_SUCCESS_WEBHOOK_URL | url | URL for success messages. | - |
| DISCORD_FAIL_WEBHOOK_URL | url | URL for fail messages. | - |
| DISCORD_NOTIFICATION_MAX_MSG_LEN | int | Maximum length of messages send to discord API. | 1500 |
Expand Down
10 changes: 10 additions & 0 deletions docs/other/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,15 @@ To play with documentation, after dependencies are in place installed with poetr

`mkdocs serve` will start development server.

## Docs release

Mike is used for docs versioning: [https://github.com/jimporter/mike](https://github.com/jimporter/mike)

After new release is triggered, manual command needs to be run (eg. tag 0.1) and then generated commit pushed to origin:

```bash
mike deploy --push --update-aliases 0.1 latest
```

<br>
<br>
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ plugins:
watch:
- docs
- mkdocs.yml

extra:
version:
provider: mike
37 changes: 36 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["Rafał Safin <[email protected]>"]
description = "A tool for performing scheduled database backups and transferring encrypted data to secure clouds, for home labs, hobby projects, etc., in environments such as k8s, docker, vms."
license = "GNU GPLv3"
name = "backuper"
version = "3.0"
version = "3.1"

[tool.poetry.dependencies]
croniter = "^1.3.7"
Expand Down Expand Up @@ -35,6 +35,7 @@ types-croniter = "^1.4.0.1"
types-requests = "^2.31.0.2"
types-google-cloud-ndb = "^2.2.0.0"
bandit = "^1.7.5"
mike = "^1.1.2"

[tool.pytest.ini_options]
addopts = "-v"
Expand Down

0 comments on commit 649a2f2

Please sign in to comment.