Commit Graph

9 Commits

Author SHA1 Message Date
Haibo Lin
5751de1096 config-dump: Allow overwritting config via -e option
The -e option was designed for defining missing config item,
but users always try to use it to overwrite existing config.

Now it works as expected.

JIRA: COMPOSE-3718
Signed-off-by: Haibo Lin <hlin@redhat.com>
2019-10-24 18:29:47 +08:00
Lubomír Sedlář
32a6415e58 config: Keep known options defined on CLI
If the validation or dumping script is given some options, they should
only be removed if they are not valid. We have to remove the invalid
ones, otherwise that would cause a warning about unknown options.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2019-06-25 15:13:16 +02:00
Lubomír Sedlář
d063217d6f config-dump: Report better error for non-existing sources
JIRA: COMPOSE-3624
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2019-06-25 14:42:50 +02:00
Lubomír Sedlář
acd3c19618 config-validate: Allow defining variables
When trying to validate a template that should later be filled in with
`pungi-config-dump`, there will be errors about undefined variables.
These are meant to be set when the template is populated.

This patch adds support for `-e`, `--define` argument to the validation
script that can be used to suppress these errors.

Alternatively a JSON file is read from the directory with config file
that can contain values for the variables.

The `--define` option is changed in both validation and dumping to allow
empty string as an accepted value.

JIRA: COMPOSE-3599
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2019-06-21 12:47:50 +02:00
Lubomír Sedlář
217fcd6c02 config-dump: Allow dumping config for multi compose
Clone the main config, all referenced parts and included variants or
comps files.

This requires a new argument: destination directory to which to write
the copied files.

JIRA: COMPOSE-3289
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2019-05-27 08:42:42 +02:00
Lubomír Sedlář
b165866f39 config-dump: Fix crash when used without --define
The default value is None, which is not iterable.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2019-04-03 13:09:12 +02:00
Lubomír Sedlář
fd0117f38c config-dump: Allow defining variables on CLI
This can be used to fill particular values to a predefined template
without editing any file disk.

JIRA: COMPOSE-3316
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2019-04-02 09:54:25 +02:00
Lubomír Sedlář
8b84aa384a config-dump: Allow freezing koji event
Accept similar argument to pungi-koji: either direct event ID, or a path
to a compose from which the event will be extracted.

It would be nice if we could reuse the path to compose given as source,
but there may be more that one compose, so ultimately we need a way to
overwrite it anyway.

JIRA: COMPOSE-3278
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2019-02-26 10:52:45 +01:00
Lubomír Sedlář
df35f26910 Add script to merge and dump multiple configuration files
The script can either take config from an existing compose, or load
files by path. By default it will perform full validation (and add
default values and resolved git references). This can be turned off.

The final JSON is printed to stdout.

JIRA: COMPOSE-3066
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2018-11-26 07:59:31 +01:00