From 7c1e949d7ec5c926a3f163c53ec93d1605ccd079 Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Thu, 9 May 2024 00:39:02 -0400 Subject: [PATCH] feat: enforce conf file expectations --- Taskfile.yml | 7 +++++++ 1 file changed, 7 insertions(+) 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}}"