From 1dc91a246a890d6fe16af56b4a67eb5cfde2b8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Fri, 5 Apr 2024 15:05:29 +0200 Subject: [PATCH 1/8] [chore] move the configuration files in a `conf` folder. --- .env.example => conf/.env.example | 0 config-example.yaml => conf/config-example.yaml | 0 log_conf.yaml => conf/log_conf.yaml | 0 docs/configuration.md | 4 ++-- docs/installation/getting-started.md | 6 +++--- 5 files changed, 5 insertions(+), 5 deletions(-) rename .env.example => conf/.env.example (100%) rename config-example.yaml => conf/config-example.yaml (100%) rename log_conf.yaml => conf/log_conf.yaml (100%) diff --git a/.env.example b/conf/.env.example similarity index 100% rename from .env.example rename to conf/.env.example diff --git a/config-example.yaml b/conf/config-example.yaml similarity index 100% rename from config-example.yaml rename to conf/config-example.yaml diff --git a/log_conf.yaml b/conf/log_conf.yaml similarity index 100% rename from log_conf.yaml rename to conf/log_conf.yaml diff --git a/docs/configuration.md b/docs/configuration.md index a8e4576..e6014f4 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -7,7 +7,7 @@ There are actually two configuration files: one for the service and one for the The server configuration is done using environment variables. You can put them in a `.env` file at the root of the project. Here is a list of the useful variables, in the `.env` format: -```{literalinclude} ../.env.example +```{literalinclude} ../conf/.env.example --- caption: .env --- @@ -48,7 +48,7 @@ Argos uses a YAML configuration file to define the websites to monitor and the c Here is a simple configuration file: -```{literalinclude} ../config-example.yaml +```{literalinclude} ../conf/config-example.yaml --- caption: config.yaml --- diff --git a/docs/installation/getting-started.md b/docs/installation/getting-started.md index a71ff65..63907d3 100644 --- a/docs/installation/getting-started.md +++ b/docs/installation/getting-started.md @@ -48,14 +48,14 @@ pip install -e . The quickest way to get started is to copy the `config-example.yaml` file and edit it: ```bash -cp config-example.yaml config.yaml +cp conf/config-example.yaml config.yaml ``` @@ -65,7 +65,7 @@ You can read more about the configuration in the [configuration section](../conf Environment variables are used to configure the server. You can also put them in an `.env` file: -```{literalinclude} ../../.env.example +```{literalinclude} ../../conf/.env.example --- caption: .env --- From 1d35ea22eaf65b3e0f9a986caa41859501f38701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Fri, 5 Apr 2024 15:07:04 +0200 Subject: [PATCH 2/8] Add a new `argos version` command outputing the version. --- argos/__init__.py | 1 + argos/commands.py | 6 ++++++ docs/cli.md | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/argos/__init__.py b/argos/__init__.py index e69de29..1cf6267 100644 --- a/argos/__init__.py +++ b/argos/__init__.py @@ -0,0 +1 @@ +VERSION = "0.1.0" diff --git a/argos/commands.py b/argos/commands.py index 6de52ce..c83e550 100644 --- a/argos/commands.py +++ b/argos/commands.py @@ -9,6 +9,7 @@ from alembic import command from alembic.config import Config from argos import logging +from argos import VERSION from argos.agent import ArgosAgent @@ -40,6 +41,11 @@ def server(): pass +@cli.command() +def version(): + click.echo(VERSION) + + @cli.command() @click.argument("server_url", envvar="ARGOS_AGENT_SERVER_URL") @click.argument("auth", envvar="ARGOS_AGENT_TOKEN") diff --git a/docs/cli.md b/docs/cli.md index 2e70714..472f8d6 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -26,8 +26,9 @@ Options: --help Show this message and exit. Commands: - agent Get and run tasks to the provided server. + agent Get and run tasks to the provided server. server + version ```