feat: rename joj3-env to joj3-all-env

This commit is contained in:
张泊明518370910136 2025-01-31 18:46:02 -05:00
parent 1169287604
commit b7389e6323
Signed by untrusted user: 张泊明518370910136
GPG Key ID: CA088E6D9284F870

View File

@ -644,22 +644,18 @@ def joj3_all(
@app.command(
"joj3-env",
"joj3-all-env",
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"),
score_file_path: str = Argument(
"", 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",
),
submitter_repo_name: str = Argument(
"",
help="repository's name of the submitter",
),
scoreboard_file_name: str = Argument(
"scoreboard.csv", help="name of scoreboard file in the gitea repo"
),
@ -694,14 +690,24 @@ def joj3_env(
commit_hash = os.getenv("GITHUB_SHA")
run_id = os.getenv("RUN_ID")
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")
raise Exit(code=1)
submitter_repo_name = (repository or "").split("/")[-1]
joj3_all(
env_path,
score_file_path,
submitter,
repo_name,
grading_repo_name,
submitter_repo_name,
run_number,
scoreboard_file_name,