qontract-development-cli 0.7.1__tar.gz → 0.8.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/PKG-INFO +31 -2
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/README.md +30 -1
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/pyproject.toml +2 -2
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/shell.py +10 -19
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/templates/compose.yml.j2 +1 -1
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/setup.py +2 -2
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/LICENSE +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/__init__.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/__main__.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/cli.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/commands/__init__.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/commands/config.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/commands/env.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/commands/profile.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/completions.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/config.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/models.py +1 -1
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/templates/prep-worktree.sh.j2 +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/templates.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/utils.py +0 -0
- {qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/watchdog.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qontract-development-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: Helper tool for qontract-reconcile development
|
|
5
5
|
Home-page: http://github.com/chassing/qontract-development-cli
|
|
6
6
|
License: MIT
|
|
@@ -126,6 +126,7 @@ An environment specifies app-interface instance settings, e.g., **dev** vs. **pr
|
|
|
126
126
|
| app_interface_state_bucket | S3 bucket | empty |
|
|
127
127
|
| app_interface_state_bucket_account | AWS S3 account | empty |
|
|
128
128
|
| **config** | app-interface config | ~/workspace/qontract-reconcile/config.dev.toml |
|
|
129
|
+
| gitlab_pr_submitter_queue_url | Gitlab pr submitter queue url | |
|
|
129
130
|
| run_qontract_reconcile | Run qontract-reconcile container | true |
|
|
130
131
|
| run_qontract_server | Run qontract-server container | true |
|
|
131
132
|
| run_vault | Run vault container | false |
|
|
@@ -157,7 +158,6 @@ A profile specifies all settings to run a qontract-reconcile integration (e.g.,
|
|
|
157
158
|
| container_uid | Change ownership of /recconcile files in container to this user id | current UID |
|
|
158
159
|
| debugger | Python debugger | debugpy |
|
|
159
160
|
| dry_run | Run --dry-run mode | true |
|
|
160
|
-
| gitlab_pr_submitter_queue_url | Gitlab pr submitter queue url | |
|
|
161
161
|
| **integration_name** | Intergration name | |
|
|
162
162
|
| **integration_extra_args** | Intergration extra arguments | |
|
|
163
163
|
| log_level | Log level | info |
|
|
@@ -207,6 +207,35 @@ Running this profile will:
|
|
|
207
207
|
|
|
208
208
|
> :point_right: A git worktree cleanup isn't implemented yet
|
|
209
209
|
|
|
210
|
+
## Development
|
|
211
|
+
|
|
212
|
+
[](https://github.com/psf/black)
|
|
213
|
+
[](http://mypy-lang.org/)
|
|
214
|
+
|
|
215
|
+
### Commits
|
|
216
|
+
|
|
217
|
+
Use [Conventional Commit messages](https://www.conventionalcommits.org).
|
|
218
|
+
The most important prefixes you should have in mind are:
|
|
219
|
+
|
|
220
|
+
* `fix:` which represents bug fixes and correlates to a [SemVer](https://semver.org/) patch.
|
|
221
|
+
* `feat` represents a new feature and correlates to a SemVer minor.
|
|
222
|
+
* `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change
|
|
223
|
+
(indicated by the `!`) and will result in a SemVer major.
|
|
224
|
+
|
|
225
|
+
### Release
|
|
226
|
+
|
|
227
|
+
To release a new version, run:
|
|
228
|
+
|
|
229
|
+
```shell
|
|
230
|
+
$ make release
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
This will:
|
|
234
|
+
* Bump the version in `pyproject.toml`
|
|
235
|
+
* Update the `CHANGELOG.md`
|
|
236
|
+
* Commit the changes
|
|
237
|
+
|
|
238
|
+
|
|
210
239
|
[pypi-link]: https://pypi.org/project/qontract-development-cli/
|
|
211
240
|
[pypi-platforms]: https://img.shields.io/pypi/pyversions/qontract-development-cli
|
|
212
241
|
[pypi-version]: https://badge.fury.io/py/qontract-development-cli.svg
|
|
@@ -100,6 +100,7 @@ An environment specifies app-interface instance settings, e.g., **dev** vs. **pr
|
|
|
100
100
|
| app_interface_state_bucket | S3 bucket | empty |
|
|
101
101
|
| app_interface_state_bucket_account | AWS S3 account | empty |
|
|
102
102
|
| **config** | app-interface config | ~/workspace/qontract-reconcile/config.dev.toml |
|
|
103
|
+
| gitlab_pr_submitter_queue_url | Gitlab pr submitter queue url | |
|
|
103
104
|
| run_qontract_reconcile | Run qontract-reconcile container | true |
|
|
104
105
|
| run_qontract_server | Run qontract-server container | true |
|
|
105
106
|
| run_vault | Run vault container | false |
|
|
@@ -131,7 +132,6 @@ A profile specifies all settings to run a qontract-reconcile integration (e.g.,
|
|
|
131
132
|
| container_uid | Change ownership of /recconcile files in container to this user id | current UID |
|
|
132
133
|
| debugger | Python debugger | debugpy |
|
|
133
134
|
| dry_run | Run --dry-run mode | true |
|
|
134
|
-
| gitlab_pr_submitter_queue_url | Gitlab pr submitter queue url | |
|
|
135
135
|
| **integration_name** | Intergration name | |
|
|
136
136
|
| **integration_extra_args** | Intergration extra arguments | |
|
|
137
137
|
| log_level | Log level | info |
|
|
@@ -181,6 +181,35 @@ Running this profile will:
|
|
|
181
181
|
|
|
182
182
|
> :point_right: A git worktree cleanup isn't implemented yet
|
|
183
183
|
|
|
184
|
+
## Development
|
|
185
|
+
|
|
186
|
+
[](https://github.com/psf/black)
|
|
187
|
+
[](http://mypy-lang.org/)
|
|
188
|
+
|
|
189
|
+
### Commits
|
|
190
|
+
|
|
191
|
+
Use [Conventional Commit messages](https://www.conventionalcommits.org).
|
|
192
|
+
The most important prefixes you should have in mind are:
|
|
193
|
+
|
|
194
|
+
* `fix:` which represents bug fixes and correlates to a [SemVer](https://semver.org/) patch.
|
|
195
|
+
* `feat` represents a new feature and correlates to a SemVer minor.
|
|
196
|
+
* `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change
|
|
197
|
+
(indicated by the `!`) and will result in a SemVer major.
|
|
198
|
+
|
|
199
|
+
### Release
|
|
200
|
+
|
|
201
|
+
To release a new version, run:
|
|
202
|
+
|
|
203
|
+
```shell
|
|
204
|
+
$ make release
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
This will:
|
|
208
|
+
* Bump the version in `pyproject.toml`
|
|
209
|
+
* Update the `CHANGELOG.md`
|
|
210
|
+
* Commit the changes
|
|
211
|
+
|
|
212
|
+
|
|
184
213
|
[pypi-link]: https://pypi.org/project/qontract-development-cli/
|
|
185
214
|
[pypi-platforms]: https://img.shields.io/pypi/pyversions/qontract-development-cli
|
|
186
215
|
[pypi-version]: https://badge.fury.io/py/qontract-development-cli.svg
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "qontract-development-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.8.1"
|
|
4
4
|
description = "Helper tool for qontract-reconcile development"
|
|
5
5
|
authors = ["Christian Assing <cassing@redhat.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -53,7 +53,7 @@ ignore_missing_imports = true
|
|
|
53
53
|
|
|
54
54
|
[tool.commitizen]
|
|
55
55
|
name = "cz_conventional_commits"
|
|
56
|
-
version = "0.
|
|
56
|
+
version = "0.8.1"
|
|
57
57
|
version_files = ["pyproject.toml:version"]
|
|
58
58
|
update_changelog_on_bump = true
|
|
59
59
|
major_version_zero = true
|
{qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/shell.py
RENAMED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import copy
|
|
2
|
-
import functools
|
|
3
2
|
import json
|
|
4
3
|
import logging
|
|
5
4
|
import os
|
|
@@ -8,6 +7,7 @@ import sys
|
|
|
8
7
|
import tempfile
|
|
9
8
|
from multiprocessing import Process
|
|
10
9
|
from pathlib import Path
|
|
10
|
+
from shutil import which
|
|
11
11
|
from typing import Any
|
|
12
12
|
|
|
13
13
|
from .models import Profile
|
|
@@ -19,18 +19,9 @@ from .utils import (
|
|
|
19
19
|
|
|
20
20
|
log = logging.getLogger(__name__)
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"""Return the docker-compose command. Either 'docker compose' or 'docker-compose'.
|
|
26
|
-
|
|
27
|
-
Support the compose plugin and the compose standalone binary.
|
|
28
|
-
"""
|
|
29
|
-
try:
|
|
30
|
-
subprocess.run(["docker", "compose", "--help"], check=True, capture_output=True)
|
|
31
|
-
return ["docker", "compose"]
|
|
32
|
-
except subprocess.CalledProcessError:
|
|
33
|
-
return ["docker-compose"]
|
|
22
|
+
_docker_compose_bin = (
|
|
23
|
+
["docker-compose"] if which("docker-compose") else ["docker", "compose"]
|
|
24
|
+
)
|
|
34
25
|
|
|
35
26
|
|
|
36
27
|
def compose_up(
|
|
@@ -40,7 +31,7 @@ def compose_up(
|
|
|
40
31
|
build: bool = False,
|
|
41
32
|
) -> None:
|
|
42
33
|
log.info("Starting all containers")
|
|
43
|
-
compose_cmd = _docker_compose_bin
|
|
34
|
+
compose_cmd = _docker_compose_bin + ["-f", str(compose_file), "up", "-d"]
|
|
44
35
|
if force_recreate:
|
|
45
36
|
compose_cmd.append("--force-recreate")
|
|
46
37
|
if remove_orphan:
|
|
@@ -52,7 +43,7 @@ def compose_up(
|
|
|
52
43
|
|
|
53
44
|
def compose_restart(compose_file: Path, container: str) -> None:
|
|
54
45
|
log.info(f"Restarting {container} container")
|
|
55
|
-
compose_cmd = _docker_compose_bin
|
|
46
|
+
compose_cmd = _docker_compose_bin + [
|
|
56
47
|
"-f",
|
|
57
48
|
str(compose_file),
|
|
58
49
|
"restart",
|
|
@@ -63,12 +54,12 @@ def compose_restart(compose_file: Path, container: str) -> None:
|
|
|
63
54
|
|
|
64
55
|
def compose_down(compose_file: Path) -> None:
|
|
65
56
|
log.info("Stopping all containers")
|
|
66
|
-
compose_cmd = _docker_compose_bin
|
|
57
|
+
compose_cmd = _docker_compose_bin + ["-f", str(compose_file), "down"]
|
|
67
58
|
subprocess.run(compose_cmd)
|
|
68
59
|
|
|
69
60
|
|
|
70
61
|
def compose_log_tail(compose_file: Path) -> Process:
|
|
71
|
-
compose_cmd = _docker_compose_bin
|
|
62
|
+
compose_cmd = _docker_compose_bin + ["-f", str(compose_file), "logs", "--follow"]
|
|
72
63
|
p = EndlessProcess(target=subprocess.run, args=(compose_cmd,))
|
|
73
64
|
p.start()
|
|
74
65
|
return p
|
|
@@ -77,7 +68,7 @@ def compose_log_tail(compose_file: Path) -> Process:
|
|
|
77
68
|
def compose_list_projects() -> list[dict[str, Any]]:
|
|
78
69
|
return json.loads(
|
|
79
70
|
subprocess.run(
|
|
80
|
-
_docker_compose_bin
|
|
71
|
+
_docker_compose_bin + ["ls", "--format", "json"],
|
|
81
72
|
capture_output=True,
|
|
82
73
|
check=True,
|
|
83
74
|
).stdout
|
|
@@ -88,7 +79,7 @@ def compose_stop_project(project_name: str):
|
|
|
88
79
|
log.info("Stopping running projects")
|
|
89
80
|
for p in compose_list_projects():
|
|
90
81
|
if p["Name"] == project_name:
|
|
91
|
-
subprocess.run(_docker_compose_bin
|
|
82
|
+
subprocess.run(_docker_compose_bin + ["-f", p["ConfigFiles"], "down"])
|
|
92
83
|
|
|
93
84
|
|
|
94
85
|
def make_bundle(app_interface_path: Path, qontract_server_path: Path):
|
|
@@ -31,7 +31,7 @@ services:
|
|
|
31
31
|
{% if profile.settings.run_once %}
|
|
32
32
|
- RUN_ONCE=1
|
|
33
33
|
{% endif %}
|
|
34
|
-
- gitlab_pr_submitter_queue_url={{
|
|
34
|
+
- gitlab_pr_submitter_queue_url={{ env.settings.gitlab_pr_submitter_queue_url }}
|
|
35
35
|
- LOG_LEVEL={{ profile.settings.log_level.upper() }}
|
|
36
36
|
{% for key, value in profile.settings.additional_environment.items() %}
|
|
37
37
|
- {{ key }}={{ value }}
|
|
@@ -23,9 +23,9 @@ entry_points = \
|
|
|
23
23
|
|
|
24
24
|
setup_kwargs = {
|
|
25
25
|
'name': 'qontract-development-cli',
|
|
26
|
-
'version': '0.
|
|
26
|
+
'version': '0.8.1',
|
|
27
27
|
'description': 'Helper tool for qontract-reconcile development',
|
|
28
|
-
'long_description': '# Qontract Development CLI\n\n[][pypi-link]\n[![PyPI platforms][pypi-platforms]][pypi-link]\n\n[](https://conventionalcommits.org)\n\nQontract Development CLI supports your daily [qontract-reconcile][qontract-reconcile] development work.\n\n## Installation\n\nYou can install this library from [PyPI][pypi-link] with `pip`:\n\n```shell\n$ python3 -m pip install qontract-development-cli\n```\n\nOr install it with `pipx`:\n```shell\n$ pipx install qontract-development-cli\n```\n\nYou can also use `pipx` to run the library without installing it:\n\n```shell\n$ pipx run qontract-development-cli\n```\n\n## Quickstart\n\n* Create initial configuration\n ```shell\n $ qd config init\n ```\n <img src="demo/qd_config_init.gif" />\n\n* Create a profile `sql-query` to run the `sql-query` integration\n ```shell\n $ qd profile create sql-query\n ```\n <img src="demo/qd_profile_create.gif" />\n\n* Run `sql-query` profile\n ```shell\n $ profile run dev sql-query\n ```\n <img src="images/profile_run_sql_query.svg" />\n\n## Features\n\nQontract Development CLI currently provides the following features (get help with `-h` or `--help`):\n\n- Run `qontract-reconcile` and `qontract-server` as docker containers on your local machine\n- Support for different environments (dev, prod, ...) via the `env` command\n- Configure your [qontract-reconcile integration][qontract-reconcile] with the `profile` command\n- Support pull request reviews (see `profile create`)\n- Bootstrap your initial configurations with the `config` command\n- Shell autocompletion (see `qd --help`)\n\n## Commands\n\n### Config\n\nManage global qontract-development CLI configuration.\n\n`qd config [sub-cmd] --help`\n\n* **edit**: open the configuration file in your favorite editor\n* **init**: create a default configuration\n\n#### Settings\n| **Key** | **Description** | **Default** |\n| --------------------------- | ------------------------------------- | ------------------------------------ |\n| debug | Enable/disable debug mode | false |\n| defaults_profile | Name of defaults profile | defaults |\n| docker_compose_project_name | Docker compose project name | qontract-development |\n| editor | Your favorite editor | $EDITOR or vim |\n| environments_dir | Directory to store environment files | User config directory / environments |\n| profiles_dir | Directory to store profile files | User config directory / profiles |\n| worktrees_dir | Directory to store git repo worktrees | User cache directory / worktrees |\n\n\n## Environments\n\nAn environment specifies app-interface instance settings, e.g., **dev** vs. **prod** config and path to the actual app-interface instance.\n\n`qd env [sub-cmd] --help`\n\n* **edit**: Create/edit an environment file in your editor.\n* **ls**: List all available environments.\n* **rm**: Remove environment.\n* **show**: Display environment.\n\n\n#### Settings\n\n| **Key** | **Description** | **Default** |\n| ---------------------------------- | ------------------------------------ | ---------------------------------------------- |\n| **app_interface_path** | Path to local app-interface instance | ~/workspace/app-interface |\n| app_interface_state_bucket | S3 bucket | empty |\n| app_interface_state_bucket_account | AWS S3 account | empty |\n| **config** | app-interface config | ~/workspace/qontract-reconcile/config.dev.toml |\n| run_qontract_reconcile | Run qontract-reconcile container | true |\n| run_qontract_server | Run qontract-server container | true |\n| run_vault | Run vault container | false |\n\n> :point_right: **Bold keys** are mandatory or should be customized.\n\n## Profiles\n\nA profile specifies all settings to run a qontract-reconcile integration (e.g., *sql-query*).\n\n`qd profile [sub-cmd] --help`\n\n* **create**: Create a new profile to run an integration.\n\n Supports the creation of a new profile from an open PR/MR. See `qd profile create --help` for all available options.\n\n* **edit**: Edit a profile in your editor.\n* **ls**: List all available profiles.\n* **rm**: Remove profile.\n* **run**: Run a profile.\n* **show**: Display profile.\n\n\n#### Settings\n\n| **Key** | **Description** | **Default** |\n| ------------------------------ | ------------------------------------------------------------------------------------------ | ----------------------------------------- |\n| additional_environment | Dictionary of additional environment variables to pass to the qontract-reconcile container | `{}` |\n| container_uid | Change ownership of /recconcile files in container to this user id | current UID |\n| debugger | Python debugger | debugpy |\n| dry_run | Run --dry-run mode | true |\n| gitlab_pr_submitter_queue_url | Gitlab pr submitter queue url | |\n| **integration_name** | Intergration name | |\n| **integration_extra_args** | Intergration extra arguments | |\n| log_level | Log level | info |\n| app_interface_path | App-interface instance path. (Overrides *env.app_interface_path*) | |\n| app_interface_pr | App-interface PR/MR number | |\n| app_interface_upstream | Upstream remote name | upstream |\n| qontract_reconcile_build_image | Build qontract-reconcile image | true |\n| qontract_reconcile_image | Qontract-reconcile image | quay.io/app-sre/qontract-reconcile:latest |\n| qontract_reconcile_path | Qontract-reconcile path | ~/workspace/qontract-reconcile |\n| qontract_reconcile_pr | Qontract-reconcile PR/MR number | |\n| qontract_reconcile_upstream | Upstream remote name | upstream |\n| qontract_server_build_image | Build qontract-server image | true |\n| qontract_server_image | Qontract-server image | quay.io/app-sre/qontract-server:latest |\n| qontract_server_path | Qontract-server path | ~/workspace/qontract-server |\n| qontract_schemas_path | Qontract-schemas path | ~/workspace/qontract-schemas |\n| qontract_schemas_pr | Qontract-schemas PR/MR number | |\n| qontract_schemas_upstream | Upstream remote name | upstream |\n| run_once | If \'true\', execute the integration once and exit | true |\n| sleep_duration_secs | If not *run_once*, sleep duration until integration runs again | 10 |\n\n> :point_right: **Bold keys** are mandatory or should be customized.\n\n### PR/MR support\n\nIt\'s a pretty handy feature to create a profile from a pull request (merge request). E.g.:\n\n```shell\n$ qd profile create --app-interface PATH_TO_YOUR_LOCAL/app-interface-dev-data --app-interface-pr NUMBER --qontract-schemas-pr NUMBER --qontract-reconcile-pr NUMBER --integration-name glitchtip --integration-extra-args \'\' glitchtip-pr-check\n```\n\nWhich results into this profile:\n\n```shell\n$ qd profile show glitchtip-pr-check\n---\napp_interface_path: PATH_TO_YOUR_LOCAL/app-interface-dev-data\napp_interface_pr: NUMBER\nintegration_name: glitchtip\nqontract_reconcile_pr: NUMBER\nqontract_schemas_pr: NUMBER\n```\n\nRunning this profile will:\n* Create new git worktrees (see `config.worktrees_dir`) for app-interface-dev-data, qontract-schema, and qontract-reconcile PRs\n* Start the containers with the adapted path to these worktrees\n* Restarting the profile will fetch PR updates\n\n> :point_right: A git worktree cleanup isn\'t implemented yet\n\n[pypi-link]: https://pypi.org/project/qontract-development-cli/\n[pypi-platforms]: https://img.shields.io/pypi/pyversions/qontract-development-cli\n[pypi-version]: https://badge.fury.io/py/qontract-development-cli.svg\n[qontract-reconcile]: https://github.com/app-sre/qontract-reconcile\n',
|
|
28
|
+
'long_description': '# Qontract Development CLI\n\n[][pypi-link]\n[![PyPI platforms][pypi-platforms]][pypi-link]\n\n[](https://conventionalcommits.org)\n\nQontract Development CLI supports your daily [qontract-reconcile][qontract-reconcile] development work.\n\n## Installation\n\nYou can install this library from [PyPI][pypi-link] with `pip`:\n\n```shell\n$ python3 -m pip install qontract-development-cli\n```\n\nOr install it with `pipx`:\n```shell\n$ pipx install qontract-development-cli\n```\n\nYou can also use `pipx` to run the library without installing it:\n\n```shell\n$ pipx run qontract-development-cli\n```\n\n## Quickstart\n\n* Create initial configuration\n ```shell\n $ qd config init\n ```\n <img src="demo/qd_config_init.gif" />\n\n* Create a profile `sql-query` to run the `sql-query` integration\n ```shell\n $ qd profile create sql-query\n ```\n <img src="demo/qd_profile_create.gif" />\n\n* Run `sql-query` profile\n ```shell\n $ profile run dev sql-query\n ```\n <img src="images/profile_run_sql_query.svg" />\n\n## Features\n\nQontract Development CLI currently provides the following features (get help with `-h` or `--help`):\n\n- Run `qontract-reconcile` and `qontract-server` as docker containers on your local machine\n- Support for different environments (dev, prod, ...) via the `env` command\n- Configure your [qontract-reconcile integration][qontract-reconcile] with the `profile` command\n- Support pull request reviews (see `profile create`)\n- Bootstrap your initial configurations with the `config` command\n- Shell autocompletion (see `qd --help`)\n\n## Commands\n\n### Config\n\nManage global qontract-development CLI configuration.\n\n`qd config [sub-cmd] --help`\n\n* **edit**: open the configuration file in your favorite editor\n* **init**: create a default configuration\n\n#### Settings\n| **Key** | **Description** | **Default** |\n| --------------------------- | ------------------------------------- | ------------------------------------ |\n| debug | Enable/disable debug mode | false |\n| defaults_profile | Name of defaults profile | defaults |\n| docker_compose_project_name | Docker compose project name | qontract-development |\n| editor | Your favorite editor | $EDITOR or vim |\n| environments_dir | Directory to store environment files | User config directory / environments |\n| profiles_dir | Directory to store profile files | User config directory / profiles |\n| worktrees_dir | Directory to store git repo worktrees | User cache directory / worktrees |\n\n\n## Environments\n\nAn environment specifies app-interface instance settings, e.g., **dev** vs. **prod** config and path to the actual app-interface instance.\n\n`qd env [sub-cmd] --help`\n\n* **edit**: Create/edit an environment file in your editor.\n* **ls**: List all available environments.\n* **rm**: Remove environment.\n* **show**: Display environment.\n\n\n#### Settings\n\n| **Key** | **Description** | **Default** |\n| ---------------------------------- | ------------------------------------ | ---------------------------------------------- |\n| **app_interface_path** | Path to local app-interface instance | ~/workspace/app-interface |\n| app_interface_state_bucket | S3 bucket | empty |\n| app_interface_state_bucket_account | AWS S3 account | empty |\n| **config** | app-interface config | ~/workspace/qontract-reconcile/config.dev.toml |\n| gitlab_pr_submitter_queue_url | Gitlab pr submitter queue url | |\n| run_qontract_reconcile | Run qontract-reconcile container | true |\n| run_qontract_server | Run qontract-server container | true |\n| run_vault | Run vault container | false |\n\n> :point_right: **Bold keys** are mandatory or should be customized.\n\n## Profiles\n\nA profile specifies all settings to run a qontract-reconcile integration (e.g., *sql-query*).\n\n`qd profile [sub-cmd] --help`\n\n* **create**: Create a new profile to run an integration.\n\n Supports the creation of a new profile from an open PR/MR. See `qd profile create --help` for all available options.\n\n* **edit**: Edit a profile in your editor.\n* **ls**: List all available profiles.\n* **rm**: Remove profile.\n* **run**: Run a profile.\n* **show**: Display profile.\n\n\n#### Settings\n\n| **Key** | **Description** | **Default** |\n| ------------------------------ | ------------------------------------------------------------------------------------------ | ----------------------------------------- |\n| additional_environment | Dictionary of additional environment variables to pass to the qontract-reconcile container | `{}` |\n| container_uid | Change ownership of /recconcile files in container to this user id | current UID |\n| debugger | Python debugger | debugpy |\n| dry_run | Run --dry-run mode | true |\n| **integration_name** | Intergration name | |\n| **integration_extra_args** | Intergration extra arguments | |\n| log_level | Log level | info |\n| app_interface_path | App-interface instance path. (Overrides *env.app_interface_path*) | |\n| app_interface_pr | App-interface PR/MR number | |\n| app_interface_upstream | Upstream remote name | upstream |\n| qontract_reconcile_build_image | Build qontract-reconcile image | true |\n| qontract_reconcile_image | Qontract-reconcile image | quay.io/app-sre/qontract-reconcile:latest |\n| qontract_reconcile_path | Qontract-reconcile path | ~/workspace/qontract-reconcile |\n| qontract_reconcile_pr | Qontract-reconcile PR/MR number | |\n| qontract_reconcile_upstream | Upstream remote name | upstream |\n| qontract_server_build_image | Build qontract-server image | true |\n| qontract_server_image | Qontract-server image | quay.io/app-sre/qontract-server:latest |\n| qontract_server_path | Qontract-server path | ~/workspace/qontract-server |\n| qontract_schemas_path | Qontract-schemas path | ~/workspace/qontract-schemas |\n| qontract_schemas_pr | Qontract-schemas PR/MR number | |\n| qontract_schemas_upstream | Upstream remote name | upstream |\n| run_once | If \'true\', execute the integration once and exit | true |\n| sleep_duration_secs | If not *run_once*, sleep duration until integration runs again | 10 |\n\n> :point_right: **Bold keys** are mandatory or should be customized.\n\n### PR/MR support\n\nIt\'s a pretty handy feature to create a profile from a pull request (merge request). E.g.:\n\n```shell\n$ qd profile create --app-interface PATH_TO_YOUR_LOCAL/app-interface-dev-data --app-interface-pr NUMBER --qontract-schemas-pr NUMBER --qontract-reconcile-pr NUMBER --integration-name glitchtip --integration-extra-args \'\' glitchtip-pr-check\n```\n\nWhich results into this profile:\n\n```shell\n$ qd profile show glitchtip-pr-check\n---\napp_interface_path: PATH_TO_YOUR_LOCAL/app-interface-dev-data\napp_interface_pr: NUMBER\nintegration_name: glitchtip\nqontract_reconcile_pr: NUMBER\nqontract_schemas_pr: NUMBER\n```\n\nRunning this profile will:\n* Create new git worktrees (see `config.worktrees_dir`) for app-interface-dev-data, qontract-schema, and qontract-reconcile PRs\n* Start the containers with the adapted path to these worktrees\n* Restarting the profile will fetch PR updates\n\n> :point_right: A git worktree cleanup isn\'t implemented yet\n\n## Development\n\n[](https://github.com/psf/black)\n[](http://mypy-lang.org/)\n\n### Commits\n\nUse [Conventional Commit messages](https://www.conventionalcommits.org).\nThe most important prefixes you should have in mind are:\n\n* `fix:` which represents bug fixes and correlates to a [SemVer](https://semver.org/) patch.\n* `feat` represents a new feature and correlates to a SemVer minor.\n* `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change\n (indicated by the `!`) and will result in a SemVer major.\n\n### Release\n\nTo release a new version, run:\n\n```shell\n$ make release\n```\n\nThis will:\n* Bump the version in `pyproject.toml`\n* Update the `CHANGELOG.md`\n* Commit the changes\n\n\n[pypi-link]: https://pypi.org/project/qontract-development-cli/\n[pypi-platforms]: https://img.shields.io/pypi/pyversions/qontract-development-cli\n[pypi-version]: https://badge.fury.io/py/qontract-development-cli.svg\n[qontract-reconcile]: https://github.com/app-sre/qontract-reconcile\n',
|
|
29
29
|
'author': 'Christian Assing',
|
|
30
30
|
'author_email': 'cassing@redhat.com',
|
|
31
31
|
'maintainer': 'None',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/cli.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/config.py
RENAMED
|
File without changes
|
{qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/models.py
RENAMED
|
@@ -20,6 +20,7 @@ class EnvSettings(BaseModel):
|
|
|
20
20
|
app_interface_state_bucket: str = ""
|
|
21
21
|
app_interface_state_bucket_account: str = ""
|
|
22
22
|
config: Path = Path("~/workspace/qontract-reconcile/config.dev.toml")
|
|
23
|
+
gitlab_pr_submitter_queue_url: str = ""
|
|
23
24
|
run_qontract_reconcile: bool = True
|
|
24
25
|
run_qontract_server: bool = True
|
|
25
26
|
run_vault: bool = False
|
|
@@ -29,7 +30,6 @@ class ProfileSettings(BaseModel):
|
|
|
29
30
|
container_uid: int = os.getuid()
|
|
30
31
|
debugger: str = "debugpy"
|
|
31
32
|
dry_run: bool = True
|
|
32
|
-
gitlab_pr_submitter_queue_url: str = ""
|
|
33
33
|
integration_extra_args: str
|
|
34
34
|
integration_name: str
|
|
35
35
|
log_level: str = "INFO"
|
|
File without changes
|
|
File without changes
|
{qontract_development_cli-0.7.1 → qontract_development_cli-0.8.1}/qontract_development_cli/utils.py
RENAMED
|
File without changes
|
|
File without changes
|