File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 2020from tutor .exceptions import TutorError
2121from tutor .tasks import BaseComposeTaskRunner
2222from tutor .types import Config
23+ from tutor .utils import check_output
2324
2425
2526class ComposeTaskRunner (BaseComposeTaskRunner ):
@@ -33,9 +34,12 @@ def docker_compose(self, *command: str) -> int:
3334 """
3435 Run docker-compose with the right yml files.
3536 """
36- if "start" in command or "up" in command or "restart" in command :
37- # Note that we don't trigger the action on "run". That's because we
38- # don't want to trigger the action for every initialization script.
37+ if self .project_name not in str (
38+ check_output ("docker" , "compose" , "ls" )
39+ ) and any (word in command for word in ("start" , "up" , "restart" , "run" )):
40+ # We would trigger the action if project is not currently running
41+ # Running it would always stop previously running project
42+ # So there is no need to trigger this action in that case
3943 hooks .Actions .COMPOSE_PROJECT_STARTED .do (
4044 self .root , self .config , self .project_name
4145 )
You can’t perform that action at this time.
0 commit comments