From 96d18dc9f6d5dedcb06dd5c7c47b43541ea3784e Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 9 Jul 2026 07:32:49 +0200 Subject: [PATCH] fix: support output environment --- README.fr.md | 10 ++-- README.md | 10 ++-- .../rougail_user_data_environment.po | 45 +++++++++++------- locale/rougail_user_data_environment.pot | 37 ++++++++------ src/rougail/user_data_environment/config.py | 18 +++++-- .../rougail_user_data_environment.mo | Bin 3649 -> 3965 bytes 6 files changed, 77 insertions(+), 43 deletions(-) diff --git a/README.fr.md b/README.fr.md index cd4d871..61ceba2 100644 --- a/README.fr.md +++ b/README.fr.md @@ -19,8 +19,8 @@ include_toc: true > *`désactivé`*\ > **Désactivé** : si environment n'est pas défini dans "[sélection pour user data](#step.user_data)". -| Variable | Description | Valeur par défaut | Type | Validateur | -|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|---------------------------------------------------------------------------------------------------|------------------------------------------------------| -| **environment.default_environment_name**
**Ligne de commande** :
--environment.default_environment_name
**Variable d'environnement** : ROUGAILCLI_ENVIRONMENT.DEFAULT_ENVIRONMENT_NAME | Nom du préfix d'environnement par défaut. | ROUGAIL | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | Doit seulement utiliser des caractères en majuscule. | -| **environment.custom_separator**
**Ligne de commande** :
--environment.custom_separator
**Variable d'environnement** : ROUGAILCLI_ENVIRONMENT.CUSTOM_SEPARATOR | Remplace le caractère séparateur « . » dans les chemins par un autre.
Le caractère point (« . ») peut ne pas être autorisé dans le nom de la variable d'environnement. Attention, le nom de la variable avec des points est toujours disponible en plus du nom avec ce caractère. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | | -| **environment.with_secrets**
**Ligne de commande** :
• --environment.with_secrets
• --environment.no-with_secrets
**Variable d'environnement** : ROUGAILCLI_ENVIRONMENT.WITH_SECRETS | Les variables d'environnement peuvent contenir des secrets. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | | +| Variable | Description | Valeur par défaut | Type | Contrôle des accès | Validateur | +|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------| +| **environment.default_environment_name**
**Ligne de commande** :
--environment.default_environment_name
**Variable d'environnement** : ROUGAILCLI_ENVIRONMENT.DEFAULT_ENVIRONMENT_NAME | Nom du préfix d'environnement par défaut. | ROUGAIL | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | *`désactivé`*
**Désactivé** : si "__.main_namespace" est à null ou environment n'est pas défini dans "[sélection pour user data](#step.user_data)". | Doit seulement utiliser des caractères en majuscule. | +| **environment.custom_separator**
**Ligne de commande** :
--environment.custom_separator
**Variable d'environnement** : ROUGAILCLI_ENVIRONMENT.CUSTOM_SEPARATOR | Remplace le caractère séparateur « . » dans les chemins par un autre.
Le caractère point (« . ») peut ne pas être autorisé dans le nom de la variable d'environnement. Attention, le nom de la variable avec des points est toujours disponible en plus du nom avec ce caractère. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | *`désactivé`*
**Désactivé** : si environment n'est pas défini dans "[sélection pour user data](#step.user_data)". | | +| **environment.with_secrets**
**Ligne de commande** :
• --environment.with_secrets
• --environment.no-with_secrets
**Variable d'environnement** : ROUGAILCLI_ENVIRONMENT.WITH_SECRETS | Les variables d'environnement peuvent contenir des secrets. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | *`désactivé`*
**Désactivé** : si environment n'est pas défini dans "[sélection pour user data](#step.user_data)". | | diff --git a/README.md b/README.md index 9b2fc1f..54a69ab 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ include_toc: true > *`disabled`*\ > **Disabled**: if environment is not set in "[select for user data](#step.user_data)". -| Variable | Description | Default value | Type | Validator | -|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|-------------------------------------------------------------------------------------------------|--------------------------------------| -| **environment.default_environment_name**
**Command line**:
--environment.default_environment_name
**Environment variable**: ROUGAILCLI_ENVIRONMENT.DEFAULT_ENVIRONMENT_NAME | Name of the default environment prefix. | ROUGAIL | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Should only use uppercase character. | -| **environment.custom_separator**
**Command line**:
--environment.custom_separator
**Environment variable**: ROUGAILCLI_ENVIRONMENT.CUSTOM_SEPARATOR | Replace the separator character "." in path by an other.
The character dot (".") may not be allowed in the environment variable name. Note that the variable name with dots is always available in addition to the name with this character. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | | -| **environment.with_secrets**
**Command line**:
• --environment.with_secrets
• --environment.no-with_secrets
**Environment variable**: ROUGAILCLI_ENVIRONMENT.WITH_SECRETS | Environnement variables may contain secrets. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | | +| Variable | Description | Default value | Type | Access control | Validator | +|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------| +| **environment.default_environment_name**
**Command line**:
--environment.default_environment_name
**Environment variable**: ROUGAILCLI_ENVIRONMENT.DEFAULT_ENVIRONMENT_NAME | Name of the default environment prefix. | ROUGAIL | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | *`disabled`*
**Disabled**: if "__.main_namespace" is null or environment is not set in "[select for user data](#step.user_data)". | Should only use uppercase character. | +| **environment.custom_separator**
**Command line**:
--environment.custom_separator
**Environment variable**: ROUGAILCLI_ENVIRONMENT.CUSTOM_SEPARATOR | Replace the separator character "." in path by an other.
The character dot (".") may not be allowed in the environment variable name. Note that the variable name with dots is always available in addition to the name with this character. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | *`disabled`*
**Disabled**: if environment is not set in "[select for user data](#step.user_data)". | | +| **environment.with_secrets**
**Command line**:
• --environment.with_secrets
• --environment.no-with_secrets
**Environment variable**: ROUGAILCLI_ENVIRONMENT.WITH_SECRETS | Environnement variables may contain secrets. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | *`disabled`*
**Disabled**: if environment is not set in "[select for user data](#step.user_data)". | | diff --git a/locale/fr/LC_MESSAGES/rougail_user_data_environment.po b/locale/fr/LC_MESSAGES/rougail_user_data_environment.po index 6206313..29ba636 100644 --- a/locale/fr/LC_MESSAGES/rougail_user_data_environment.po +++ b/locale/fr/LC_MESSAGES/rougail_user_data_environment.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2026-06-13 06:47+0200\n" -"PO-Revision-Date: 2026-06-13 06:48+0200\n" +"POT-Creation-Date: 2026-07-09 07:30+0200\n" +"PO-Revision-Date: 2026-07-09 07:31+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -32,17 +32,17 @@ msgstr "" "le nom d'une variable doit être un nom en minuscule lorsque vous voulez " "utiliser de données utilisateur \"environment\", donc \"{0}\" est invalide" -#: src/rougail/user_data_environment/config.py:34 +#: src/rougail/user_data_environment/config.py:33 msgid "Load user data from environment variables" msgstr "Charge les variables d'environnement" -#: src/rougail/user_data_environment/config.py:36 +#: src/rougail/user_data_environment/config.py:35 msgid "Variable values can be defined directly from an environment variable." msgstr "" "Les valeurs des variables peuvent être définies directement à partir d'une " "variable d'environnement." -#: src/rougail/user_data_environment/config.py:38 +#: src/rougail/user_data_environment/config.py:37 msgid "" "Environnement variable names begin with a prefix (by default ROUGAIL_) " "followed by the variable path in uppercase, for example: " @@ -54,7 +54,7 @@ msgstr "" "ROUGAIL_MA_VARIABLE. Si vous utilisez des espaces de noms, le préfixe sera " "le nom de l'espace de noms en majuscule." -#: src/rougail/user_data_environment/config.py:40 +#: src/rougail/user_data_environment/config.py:39 msgid "" "Note that variable paths can contain dots (\".\"), which are not permitted " "everywhere. To avoid any issues, use the `env` command, for example: `env " @@ -64,7 +64,7 @@ msgstr "" "ne sont pas autorisés partout. Pour éviter tout problème, utilisez la " "commande `env`, par exemple : `env ROUGAIL_MA_FAMILLE.MA_VARIABLE=1 rougail`" -#: src/rougail/user_data_environment/config.py:42 +#: src/rougail/user_data_environment/config.py:41 msgid "" "For values, there is no difference between a number and a letter (they can " "be enclosed in quotes or not). However, booleans are True or False. The " @@ -74,23 +74,31 @@ msgstr "" "(ils peuvent être entre guillemets ou non). Cependant, les booléens sont " "True ou False. Le séparateur pour les variables multiple est la virgule." -#: src/rougail/user_data_environment/config.py:47 -msgid "if environment is not set in \"step.user_data\"" -msgstr "si environment n'est pas défini dans \"step.user_data\"" +#: src/rougail/user_data_environment/config.py:46 +msgid "if environment is not set in \"_.step.user_data\"" +msgstr "si environment n'est pas défini dans \"_.step.user_data\"" -#: src/rougail/user_data_environment/config.py:50 +#: src/rougail/user_data_environment/config.py:49 msgid "Name of the default environment prefix" msgstr "Nom du préfix d'environnement par défaut" -#: src/rougail/user_data_environment/config.py:56 +#: src/rougail/user_data_environment/config.py:55 msgid "should only use uppercase character" msgstr "doit seulement utiliser des caractères en majuscule" -#: src/rougail/user_data_environment/config.py:62 +#: src/rougail/user_data_environment/config.py:60 +msgid "" +"if \"__.main_namespace\" is null or environment is not set in " +"\"__.step.user_data\"" +msgstr "" +"si \"__.main_namespace\" est à null ou environment n'est pas défini dans " +"\"__.step.user_data\"" + +#: src/rougail/user_data_environment/config.py:63 msgid "Replace the separator character \".\" in path by an other" msgstr "Remplace le caractère séparateur « . » dans les chemins par un autre" -#: src/rougail/user_data_environment/config.py:63 +#: src/rougail/user_data_environment/config.py:64 msgid "" "The character dot (\".\") may not be allowed in the environment variable " "name. Note that the variable name with dots is always available in addition " @@ -100,11 +108,16 @@ msgstr "" "variable d'environnement. Attention, le nom de la variable avec des points " "est toujours disponible en plus du nom avec ce caractère." -#: src/rougail/user_data_environment/config.py:67 +#: src/rougail/user_data_environment/config.py:70 +#: src/rougail/user_data_environment/config.py:79 +msgid "if environment is not set in \"__.step.user_data\"" +msgstr "si environment n'est pas défini dans \"__.step.user_data\"" + +#: src/rougail/user_data_environment/config.py:73 msgid "Environnement variables may contain secrets" msgstr "Les variables d'environnement peuvent contenir des secrets" -#: src/rougail/user_data_environment/data.py:64 +#: src/rougail/user_data_environment/data.py:66 msgid "environment variable" msgstr "les variables d'environnement" diff --git a/locale/rougail_user_data_environment.pot b/locale/rougail_user_data_environment.pot index a55c8df..72f0d6f 100644 --- a/locale/rougail_user_data_environment.pot +++ b/locale/rougail_user_data_environment.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2026-06-13 06:49+0200\n" +"POT-Creation-Date: 2026-07-09 07:32+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,51 +23,60 @@ msgstr "" msgid "variable name must be a lowercase name when we want to use user data \"environment\", so \"{0}\" is invalid" msgstr "" -#: src/rougail/user_data_environment/config.py:34 +#: src/rougail/user_data_environment/config.py:33 msgid "Load user data from environment variables" msgstr "" -#: src/rougail/user_data_environment/config.py:36 +#: src/rougail/user_data_environment/config.py:35 msgid "Variable values can be defined directly from an environment variable." msgstr "" -#: src/rougail/user_data_environment/config.py:38 +#: src/rougail/user_data_environment/config.py:37 msgid "Environnement variable names begin with a prefix (by default ROUGAIL_) followed by the variable path in uppercase, for example: ROUGAIL_MY_VARIABLE. If you are using namespaces, the prefix is the name of the namespace in uppercase." msgstr "" -#: src/rougail/user_data_environment/config.py:40 +#: src/rougail/user_data_environment/config.py:39 msgid "Note that variable paths can contain dots (\".\"), which are not permitted everywhere. To avoid any issues, use the `env` command, for example: `env ROUGAIL_MY_FAMILY.MY_VARIABLE=1 rougail`" msgstr "" -#: src/rougail/user_data_environment/config.py:42 +#: src/rougail/user_data_environment/config.py:41 msgid "For values, there is no difference between a number and a letter (they can be enclosed in quotes or not). However, booleans are True or False. The separator for multiple variables is a comma." msgstr "" -#: src/rougail/user_data_environment/config.py:47 -msgid "if environment is not set in \"step.user_data\"" +#: src/rougail/user_data_environment/config.py:46 +msgid "if environment is not set in \"_.step.user_data\"" msgstr "" -#: src/rougail/user_data_environment/config.py:50 +#: src/rougail/user_data_environment/config.py:49 msgid "Name of the default environment prefix" msgstr "" -#: src/rougail/user_data_environment/config.py:56 +#: src/rougail/user_data_environment/config.py:55 msgid "should only use uppercase character" msgstr "" -#: src/rougail/user_data_environment/config.py:62 -msgid "Replace the separator character \".\" in path by an other" +#: src/rougail/user_data_environment/config.py:60 +msgid "if \"__.main_namespace\" is null or environment is not set in \"__.step.user_data\"" msgstr "" #: src/rougail/user_data_environment/config.py:63 +msgid "Replace the separator character \".\" in path by an other" +msgstr "" + +#: src/rougail/user_data_environment/config.py:64 msgid "The character dot (\".\") may not be allowed in the environment variable name. Note that the variable name with dots is always available in addition to the name with this character." msgstr "" -#: src/rougail/user_data_environment/config.py:67 +#: src/rougail/user_data_environment/config.py:70 +#: src/rougail/user_data_environment/config.py:79 +msgid "if environment is not set in \"__.step.user_data\"" +msgstr "" + +#: src/rougail/user_data_environment/config.py:73 msgid "Environnement variables may contain secrets" msgstr "" -#: src/rougail/user_data_environment/data.py:64 +#: src/rougail/user_data_environment/data.py:66 msgid "environment variable" msgstr "" diff --git a/src/rougail/user_data_environment/config.py b/src/rougail/user_data_environment/config.py index daf604d..2b571a0 100644 --- a/src/rougail/user_data_environment/config.py +++ b/src/rougail/user_data_environment/config.py @@ -43,7 +43,7 @@ environment: jinja: | {{{{ _.step.user_data is propertyerror or 'environment' not in _.step.user_data }}}} return_type: boolean - description: {_('if environment is not set in "step.user_data"')} + description: {_('if environment is not set in "_.step.user_data"')} default_environment_name: description: {_("Name of the default environment prefix")} @@ -54,17 +54,29 @@ environment: return_type: boolean description: {_("should only use uppercase character")} disabled: - variable: __.main_namespace - when_not: null + jinja: | + {{{{ not __.main_namespace or 'environment' not in __.step.user_data }}}} + return_type: boolean + description: {_('if "__.main_namespace" is null or environment is not set in "__.step.user_data"')} custom_separator: description: {_('Replace the separator character "." in path by an other')} help: {_('The character dot (".") may not be allowed in the environment variable name. Note that the variable name with dots is always available in addition to the name with this character.')} mandatory: false + disabled: + jinja: | + {{{{ 'environment' not in __.step.user_data }}}} + return_type: boolean + description: {_('if environment is not set in "__.step.user_data"')} with_secrets: description: {_("Environnement variables may contain secrets")} default: true + disabled: + jinja: | + {{{{ 'environment' not in __.step.user_data }}}} + return_type: boolean + description: {_('if environment is not set in "__.step.user_data"')} """ return { "name": "environment", diff --git a/src/rougail/user_data_environment/locale/fr/LC_MESSAGES/rougail_user_data_environment.mo b/src/rougail/user_data_environment/locale/fr/LC_MESSAGES/rougail_user_data_environment.mo index ac5268dcfbc749f74a20ecdf7a3ab3a507bd800a..8f635ca255df66d5076fb3593946aebfe6157d69 100644 GIT binary patch delta 543 zcmZwDJxBs!90u^`^t95nv_c5e!#?Ok%_uNk`xsjKAZn?OqYkmu%+sX^$7(7#B7&lb z=AaxJ8X{V%ErP~qv%xuN5PJF;ec^w<_x-=`-ScvH?y@KU<`nnA;b6I0=PVb?FYv*! zO^bAg_Ruv0a7&MA7o9f(9dwJ{&AO1mXkR)igb_;+qp?M=>WZ^d$eTNEkZNX{(e@y9uT}H?x9Yf6dFXn4SmAkD&&O? z(c_clU{Z;vb zn8l4DX#o$hi%nd^9Y+eVj$7ytOXGNs2iU^ARMRiT92@g4LvR~=_=qtMy$?$z`tFGI zg+G|VkBF4RKkQ#{G0LHsj7e{}hy8iWacK%~@De-d<7PrCil#zw#l}Oz=FCKdZtxkN yEt?tcM%Xhm#xp2RL#g1_R2+NaPTD8;HR|VA3$rVJskk0A!uzhh@G|z!d;bUK95DC*