-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,14 @@ | |
from ogdc_runner.recipe.simple import make_simple_workflow | ||
|
||
|
||
# TODO: How do we handle e.g. GitHub URL to recipe? | ||
# handling github by | ||
# checking if path is a URL | ||
def is_url(recipe_path): | ||
""" Check if the path is a valid URL.""" | ||
parsed = urlparse(recipe_path) | ||
return parsed.scheme in ('http', 'https') and parsed.netloc != '' | ||
|
||
|
||
def convert_url_to_ssh(recipe_path): | ||
""" Convert https github url to ssh format.""" | ||
parsed = urlparse(recipe_path) | ||
|
@@ -30,6 +30,7 @@ def convert_url_to_ssh(recipe_path): | |
repo_path = parsed.path.lstrip("/") | ||
return f"[email protected]:{repo_path}.git" | ||
|
||
|
||
def clone_repo(ssh_url): | ||
"""Clone the repository into a temporary directory.""" | ||
temp_dir = tempfile.mkdtemp() | ||
|
@@ -57,7 +58,8 @@ def clone_repo(ssh_url): | |
recipe_name = click.argument( | ||
"recipe_name", | ||
required=False, | ||
type = str) | ||
type = str | ||
) | ||
|
||
|
||
@click.group | ||
|
@@ -101,7 +103,8 @@ def check_workflow_status(workflow_name: str) -> None: | |
|
||
@cli.command | ||
@recipe_path | ||
def submit_and_wait(recipe_path: Path) -> None: | ||
@recipe_name | ||
def submit_and_wait(recipe_path, recipe_name=None) -> None: | ||
"""Submit a recipe to OGDC for execution and wait until completion.""" | ||
workflow_name = _submit_workflow(recipe_path) | ||
|
||
|