File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 1
1
import click
2
2
3
- from .deploy import deploy
3
+ from .deploy import deploy , test
4
4
5
5
6
6
@click .group ()
@@ -9,7 +9,7 @@ def cli():
9
9
10
10
11
11
cli .add_command (deploy )
12
-
12
+ cli . add_command ( test )
13
13
14
14
if __name__ == "__main__" :
15
15
cli ()
Original file line number Diff line number Diff line change @@ -43,3 +43,29 @@ def deploy() -> None:
43
43
project .scoreboard_backend .commit ()
44
44
else :
45
45
click .echo ("WARN: no scoreboard backend, skipping..." )
46
+
47
+ @click .command ()
48
+ def test () -> None :
49
+ try :
50
+ project_config = find_files (["rcds" ], SUPPORTED_EXTENSIONS , recurse = True )[
51
+ "rcds"
52
+ ].parent
53
+ except KeyError :
54
+ click .echo ("Could not find project root!" )
55
+ exit (1 )
56
+ click .echo (f"Loading project at { project_config } " )
57
+ project = rcds .Project (project_config )
58
+ click .echo ("Initializing backends" )
59
+ project .load_backends ()
60
+ click .echo ("Loading challenges" )
61
+ project .load_all_challenges ()
62
+ for challenge in project .challenges .values ():
63
+ cm = rcds .challenge .docker .ContainerManager (challenge )
64
+ for container_name , container in cm .containers .items ():
65
+ click .echo (f"{ challenge .config ['id' ]} : checking container { container_name } " )
66
+ if not container .is_built ():
67
+ click .echo (
68
+ f"{ challenge .config ['id' ]} : building container { container_name } "
69
+ f" ({ container .get_full_tag ()} )"
70
+ )
71
+ container .build ()
You can’t perform that action at this time.
0 commit comments