diff --git a/Taskfile.yml b/Taskfile.yml index 8bb5f58..e6be29f 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -11,6 +11,8 @@ tasks: desc: Builds a service by name. prefix: "build image: {{ .CLI_ARGS }}" interactive: true + preconditions: + - test -f {{.CONFIG_ROOT}}/common.env cmds: - rm -rf {{.SERVICES_ROOT}}/{{.CLI_ARGS}} - git clone "git@forge-ssh.karnov.club:spadinastan/{{.CLI_ARGS}}.git" "{{.SERVICES_ROOT}}/{{.CLI_ARGS}}" @@ -21,6 +23,9 @@ tasks: start: desc: Starts a service by name. prefix: "start: {{ .CLI_ARGS }}" + preconditions: + - test -f {{.CONFIG_ROOT}}/common.env + - test -f {{.CONFIG_ROOT}}/{{.CLI_ARGS}}.env cmds: - rm -rf {{.SERVICES_ROOT}}/{{.CLI_ARGS}} - git clone "git@forge-ssh.karnov.club:spadinastan/{{.CLI_ARGS}}.git" "{{.SERVICES_ROOT}}/{{.CLI_ARGS}}" @@ -33,6 +38,8 @@ tasks: stop: desc: Stops a service by name. prefix: "stop: {{ .CLI_ARGS }}" + preconditions: + - test -f {{.CONFIG_ROOT}}/common.env cmds: - rm -rf {{.SERVICES_ROOT}}/{{.CLI_ARGS}} - git clone "git@forge-ssh.karnov.club:spadinastan/{{.CLI_ARGS}}.git" "{{.SERVICES_ROOT}}/{{.CLI_ARGS}}"