1
0
Fork 0
Commit graph

76 commits

Author SHA1 Message Date
ba7827d83b
generate: generate: Add a identifying header to generated scripts
Add a header stating that the script was generated, which version
generated it and where to send bug reports.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-29 09:38:39 +02:00
ff663f7835
generate: generate: Handle empty control scripts
When a given control script is empty, because the current config is
missing a value for said script or is malformed, a script with only
the shebang was written. Change it, so that it now executes true.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-29 09:31:52 +02:00
ef63c0de14
containerrc: Remove optional parts from schema
A container can be created from a name and an image, no other part is
required. Reflect that in the JSON schema, by removing most top-level
required entries. Also remove the hardcoded env-vars from the schema.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-29 09:25:19 +02:00
64b797d18d
containerrc: Add json-schmea for config file
Add a json-schema generated by www.liquid-technologies.com/online-json-to-schema-converter
modified to remove hard-coded values from the example conifg (like
MySecret1).

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-26 21:49:32 +02:00
13ab593a59
generate: container: Fix printf call in Environment.create
When creating the env-vars printf is called with arguments in single
quotes to prevent variable and sub-shell expansions. However, only one
single quote was passed as an argument to printf, but two format
specifiers are present in the escpaed string.

Fix this by adding another \"'\" to the variable cmd.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-26 21:39:28 +02:00
5237a70f3e
make: Add makefile to support install
Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-26 19:26:21 +02:00
ec8e088b3f
reuse: Add LICENSE symlink for tools that expect it
Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-26 19:06:00 +02:00
83a2a38180
reuse: Add reuse information
Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-26 19:04:27 +02:00
d1e4452a5d
containerctl: Fix log_error() not logging a timestamp
As ${TODAY} was forgotten, the first argument from ${@} was used as a
timestamp instead, resulting in malformed log messages. Fix this by
adding ${TDOAY} before ${@}.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-26 16:51:40 +02:00
131ff71f34
generate: container: Use ",".join() and fix Secret.command()
Use ",".join() instead of the custom join() method and fix
Secret.command() by checking if secret_type and not target is mount...

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 16:50:24 +02:00
2216bf68da
generate: generate: Remove debug statements
No longer needed.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 16:49:55 +02:00
ca9d914449
generate: container: Remove command_join()
It is not used anywhere, so it can be safely removed.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 16:20:51 +02:00
6963fdea2a
generate: generate: Explicitly catch ConfigError
Catch ConfigError instead of Exception, which also renders noqa BLE001
obsolete.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 16:17:46 +02:00
72062edbf5
generate: container: Fix some issues reported by pylint
This fixes various issues reported by pylint. It now only reports to
issues, that can be ignored, since they're only about too many local
variables or class attributes.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 16:15:47 +02:00
e2f2b3e35f
generate: container: Fix spelling mistake
Search, not serach...

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 15:58:53 +02:00
53622827a0
generate: log: Add encoding=utf-8 to Path.open
Specify the encoding to use for the logfile.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 15:57:23 +02:00
7200d09621
containerctl: Add containerctl script
Add script to generate and exec control scripts.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 15:51:26 +02:00
b0df681fea
generate: generate: Implement writing the control scripts
Implement writing all control scripts and making them executable.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 14:45:52 +02:00
015f2e5a16
generate: container: Rename Container.crate to Container.create_container
Since the environemt creation are now seperate methods, the create and
create_container split is no longer needed.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 13:34:04 +02:00
d67dcfd466
generate: container: Remoev unused import
Remove an import that is no longer used.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 13:24:32 +02:00
13cbc2f403
generate: container: Update methods to use {create,remove}_environment
Update Container methods to use the new {create,remove}_environment
methods.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 13:22:38 +02:00
3f5ccffc4a
generate: container: Add {create,remove}_environment wrappers
Add {create,remove}_environment wrappers to the Container class, so that
the generate script can access them.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 13:17:35 +02:00
17adc701a8
generate: container: Remove if ! [ -d dir ] from Environment.create
Remove the if ! [ -d {file.parent} ] check from Envrionment.create(), as
the directory has to exists, since the script checking if it exists also
is located in that directort...

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 13:08:30 +02:00
995a66c753
generate: Add python script to generate control scripts
Generates control scripts from a given container config. For now the
actual generate.py does nothing.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 13:00:41 +02:00
d9ef9e395d
example.container: Add container example configuration
Add an example configuration to showcase different ways to configure
container options.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 12:57:26 +02:00
db93286e11
meta: Initial commit
Add a gitignore and ruff config file.

Signed-off-by: Enno Tensing <tenno@suij.in>
2025-07-22 12:56:39 +02:00