Skip to content

Commit

Permalink
Support loading recipe from a file
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaarreell committed Aug 28, 2024
1 parent 0e41611 commit 51ee162
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion newa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def load_data_from_location(location: str,
else:
stack = [location]
data: dict[str, Any] = {}
if location.startswith('https://'):
if re.search('^https?://', location):
data = yaml_parser().load(get_request(
url=location,
response_content=ResponseContentType.TEXT))
Expand Down
5 changes: 4 additions & 1 deletion newa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,10 @@ def cmd_schedule(ctx: CLIContext, arch: str) -> None:
environment=ctx.cli_environment,
context=ctx.cli_context)

config = RecipeConfig.from_yaml_url(jira_job.recipe.url)
if re.search('^https?://', jira_job.recipe.url):
config = RecipeConfig.from_yaml_url(jira_job.recipe.url)
else:
config = RecipeConfig.from_yaml_file(Path(jira_job.recipe.url))
# extend dimensions with system architecture but do not override existing settings
if 'arch' not in config.dimensions:
config.dimensions['arch'] = []
Expand Down

0 comments on commit 51ee162

Please sign in to comment.