2024-05-09 04:27:20 +00:00
|
|
|
version: '3'
|
|
|
|
|
|
|
|
output: prefixed
|
|
|
|
|
|
|
|
vars:
|
|
|
|
SERVICES_ROOT: "{{ .ROOT_DIR }}/.services"
|
|
|
|
CONFIG_ROOT: "/etc/opt/spadinastan"
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
build:
|
|
|
|
desc: Builds a service by name.
|
|
|
|
prefix: "build image: {{ .CLI_ARGS }}"
|
|
|
|
interactive: true
|
2024-05-09 04:39:02 +00:00
|
|
|
preconditions:
|
|
|
|
- test -f {{.CONFIG_ROOT}}/common.env
|
2024-05-09 04:27:20 +00:00
|
|
|
cmds:
|
|
|
|
- rm -rf {{.SERVICES_ROOT}}/{{.CLI_ARGS}}
|
2024-05-09 05:13:20 +00:00
|
|
|
- git clone "https://forge.karnov.club/spadinastan/{{.CLI_ARGS}}.git" "{{.SERVICES_ROOT}}/{{.CLI_ARGS}}"
|
2024-05-09 04:27:20 +00:00
|
|
|
- cd {{ .SERVICES_ROOT }}/{{ .CLI_ARGS }} && . ./build.sh
|
2024-05-09 05:21:32 +00:00
|
|
|
dotenv: ['{{.CONFIG_ROOT}}/common.env']
|
2024-05-09 04:27:20 +00:00
|
|
|
env:
|
|
|
|
IMAGE_VERSION: "{{.IMAGE_VERSION}}"
|
|
|
|
|
|
|
|
start:
|
|
|
|
desc: Starts a service by name.
|
|
|
|
prefix: "start: {{ .CLI_ARGS }}"
|
2024-05-09 04:39:02 +00:00
|
|
|
preconditions:
|
|
|
|
- test -f {{.CONFIG_ROOT}}/common.env
|
|
|
|
- test -f {{.CONFIG_ROOT}}/{{.CLI_ARGS}}.env
|
2024-05-09 04:27:20 +00:00
|
|
|
cmds:
|
|
|
|
- rm -rf {{.SERVICES_ROOT}}/{{.CLI_ARGS}}
|
2024-05-09 05:13:20 +00:00
|
|
|
- git clone "https://forge.karnov.club/spadinastan/{{.CLI_ARGS}}.git" "{{.SERVICES_ROOT}}/{{.CLI_ARGS}}"
|
2024-05-09 04:27:20 +00:00
|
|
|
- cd {{ .SERVICES_ROOT }}/{{ .CLI_ARGS }} && . ./start.sh
|
2024-05-09 05:21:32 +00:00
|
|
|
dotenv: ['{{.CONFIG_ROOT}}/common.env']
|
2024-05-09 04:27:20 +00:00
|
|
|
env:
|
|
|
|
IMAGE_VERSION: "{{.IMAGE_VERSION}}"
|
|
|
|
ENV_FILE_DIR: "{{.CONFIG_ROOT}}"
|
|
|
|
|
|
|
|
stop:
|
|
|
|
desc: Stops a service by name.
|
|
|
|
prefix: "stop: {{ .CLI_ARGS }}"
|
2024-05-09 04:39:02 +00:00
|
|
|
preconditions:
|
|
|
|
- test -f {{.CONFIG_ROOT}}/common.env
|
2024-05-09 04:27:20 +00:00
|
|
|
cmds:
|
|
|
|
- rm -rf {{.SERVICES_ROOT}}/{{.CLI_ARGS}}
|
2024-05-09 05:13:20 +00:00
|
|
|
- git clone "https://forge.karnov.club/spadinastan/{{.CLI_ARGS}}.git" "{{.SERVICES_ROOT}}/{{.CLI_ARGS}}"
|
2024-05-09 04:27:20 +00:00
|
|
|
- cd {{ .SERVICES_ROOT }}/{{ .CLI_ARGS }} && . ./stop.sh
|
2024-05-09 05:21:32 +00:00
|
|
|
dotenv: ['{{.CONFIG_ROOT}}/common.env']
|