forked from JOJ/Joint-Teapot
feat: rename joj3-env to joj3-all-env
This commit is contained in:
parent
1169287604
commit
b7389e6323
|
@ -644,22 +644,18 @@ def joj3_all(
|
||||||
|
|
||||||
|
|
||||||
@app.command(
|
@app.command(
|
||||||
"joj3-env",
|
"joj3-all-env",
|
||||||
help="run all joj3 tasks from env var and cli args",
|
help="run all joj3 tasks from env var and cli args",
|
||||||
)
|
)
|
||||||
def joj3_env(
|
def joj3_all_env(
|
||||||
env_path: str = Argument("", help="path to .env file"),
|
env_path: str = Argument("", help="path to .env file"),
|
||||||
score_file_path: str = Argument(
|
score_file_path: str = Argument(
|
||||||
"", help="path to score json file generated by JOJ3"
|
"", help="path to score json file generated by JOJ3"
|
||||||
),
|
),
|
||||||
repo_name: str = Argument(
|
grading_repo_name: str = Argument(
|
||||||
"",
|
"",
|
||||||
help="name of grading repo to push failed table file",
|
help="name of grading repo to push failed table file",
|
||||||
),
|
),
|
||||||
submitter_repo_name: str = Argument(
|
|
||||||
"",
|
|
||||||
help="repository's name of the submitter",
|
|
||||||
),
|
|
||||||
scoreboard_file_name: str = Argument(
|
scoreboard_file_name: str = Argument(
|
||||||
"scoreboard.csv", help="name of scoreboard file in the gitea repo"
|
"scoreboard.csv", help="name of scoreboard file in the gitea repo"
|
||||||
),
|
),
|
||||||
|
@ -694,14 +690,24 @@ def joj3_env(
|
||||||
commit_hash = os.getenv("GITHUB_SHA")
|
commit_hash = os.getenv("GITHUB_SHA")
|
||||||
run_id = os.getenv("RUN_ID")
|
run_id = os.getenv("RUN_ID")
|
||||||
groups = os.getenv("GROUPS")
|
groups = os.getenv("GROUPS")
|
||||||
if None in (submitter, run_number, exercise_name, commit_hash, run_id, groups):
|
repository = os.getenv("GITHUB_REPOSITORY")
|
||||||
|
if None in (
|
||||||
|
submitter,
|
||||||
|
run_number,
|
||||||
|
exercise_name,
|
||||||
|
commit_hash,
|
||||||
|
run_id,
|
||||||
|
groups,
|
||||||
|
repository,
|
||||||
|
):
|
||||||
logger.error("missing required env var")
|
logger.error("missing required env var")
|
||||||
raise Exit(code=1)
|
raise Exit(code=1)
|
||||||
|
submitter_repo_name = (repository or "").split("/")[-1]
|
||||||
joj3_all(
|
joj3_all(
|
||||||
env_path,
|
env_path,
|
||||||
score_file_path,
|
score_file_path,
|
||||||
submitter,
|
submitter,
|
||||||
repo_name,
|
grading_repo_name,
|
||||||
submitter_repo_name,
|
submitter_repo_name,
|
||||||
run_number,
|
run_number,
|
||||||
scoreboard_file_name,
|
scoreboard_file_name,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user