-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(RHTAPWATCH-662): add inputs to odcs compose entrypoint
Required inputs when running the odcs entrypoint to specify where the compose should be stored and where the configurations reside. Had to rename the directory name to avoid it having the same name as one of the the modules. Signed-off-by: Yftach Herzog <[email protected]>
- Loading branch information
1 parent
8831254
commit 2a72aba
Showing
13 changed files
with
133 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python3 | ||
|
||
"""Initialize and use a compose generator using ODCS""" | ||
|
||
from pathlib import Path | ||
|
||
import click | ||
import yaml | ||
|
||
from .compose_generator import ComposeGenerator | ||
from .odcs_configurations_generator import ODCSConfigurationsGenerator | ||
from .odcs_fetcher import ODCSFetcher | ||
from .odcs_requester import ODCSRequester | ||
|
||
|
||
@click.command() | ||
@click.option( | ||
"--target-path", | ||
help="Path to where the compose should be saved.", | ||
type=click.Path(path_type=Path), | ||
required=True, | ||
) | ||
@click.option( | ||
"--container-yaml-path", | ||
help="Path in which container yaml file is stored", | ||
type=click.Path(path_type=Path), | ||
required=True, | ||
) | ||
@click.option( | ||
"--content-sets-yaml-path", | ||
help="Path in which content_sets yaml file is stored", | ||
type=click.Path(path_type=Path), | ||
required=True, | ||
) | ||
def main( | ||
target_path: Path, | ||
container_yaml_path: Path, | ||
content_sets_yaml_path: Path, | ||
): | ||
""" | ||
Get inputs from container and content_sets yamls and relay them to an ODCS | ||
compose generator that will request a compose and store it in a TBD location. | ||
""" | ||
container_data: dict = yaml.safe_load(container_yaml_path.read_text()) | ||
content_sets_data: dict = yaml.safe_load(content_sets_yaml_path.read_text()) | ||
|
||
compose_generator = ComposeGenerator( | ||
configurations_generator=ODCSConfigurationsGenerator( | ||
container_data=container_data, | ||
content_sets_data=content_sets_data, | ||
), | ||
requestor=ODCSRequester(), | ||
fetcher=ODCSFetcher(target_path=target_path), | ||
) | ||
compose_generator() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() # pylint: disable=no-value-for-parameter |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters