Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rcds = "rcds.cli:cli"

[tool.poetry.dependencies]
python = ">=3.7,<4.0"
pyyaml = "^5.3.1"
pyyaml = ">=5.4.1"
pathspec = "^0.9.0"
docker = "^4.3.1"
jsonschema = "^3.2.0"
Expand Down
4 changes: 2 additions & 2 deletions rcds/cli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import click

from .deploy import deploy
from .deploy import deploy, test


@click.group()
Expand All @@ -9,7 +9,7 @@ def cli():


cli.add_command(deploy)

cli.add_command(test)

if __name__ == "__main__":
cli()
26 changes: 26 additions & 0 deletions rcds/cli/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,29 @@ def deploy() -> None:
project.scoreboard_backend.commit()
else:
click.echo("WARN: no scoreboard backend, skipping...")

@click.command()
def test() -> None:
try:
project_config = find_files(["rcds"], SUPPORTED_EXTENSIONS, recurse=True)[
"rcds"
].parent
except KeyError:
click.echo("Could not find project root!")
exit(1)
click.echo(f"Loading project at {project_config}")
project = rcds.Project(project_config)
click.echo("Initializing backends")
project.load_backends()
click.echo("Loading challenges")
project.load_all_challenges()
for challenge in project.challenges.values():
cm = rcds.challenge.docker.ContainerManager(challenge)
for container_name, container in cm.containers.items():
click.echo(f"{challenge.config['id']}: checking container {container_name}")
if not container.is_built():
click.echo(
f"{challenge.config['id']}: building container {container_name}"
f" ({container.get_full_tag()})"
)
container.build()
Loading