2022-11-13 01:10:26 +01:00
|
|
|
version: '3'
|
|
|
|
|
|
|
|
includes:
|
2022-12-10 18:16:50 +01:00
|
|
|
util:
|
|
|
|
taskfile: ./utils.yml
|
2022-11-13 01:10:26 +01:00
|
|
|
internal: true
|
2022-11-22 20:46:51 +01:00
|
|
|
dir: ..
|
2022-11-13 01:10:26 +01:00
|
|
|
|
|
|
|
vars:
|
|
|
|
COMPOSE_FILES:
|
2023-08-09 21:51:27 +02:00
|
|
|
sh: touch enabled ; find ./services -iname docker-compose.yml | grep -f enabled || exit 0
|
2022-11-23 21:44:02 +01:00
|
|
|
COMPOSE_ARGS: -f services/docker-compose.yml -f {{.COMPOSE_FILES | splitLines | join " -f "}}
|
2022-11-13 01:10:26 +01:00
|
|
|
|
|
|
|
tasks:
|
2022-12-10 18:16:50 +01:00
|
|
|
show:
|
|
|
|
desc: Show merged compose config
|
|
|
|
deps:
|
|
|
|
- util:template
|
|
|
|
cmds:
|
|
|
|
- "docker-compose {{.COMPOSE_ARGS}} config"
|
|
|
|
|
2022-11-13 01:10:26 +01:00
|
|
|
pull:
|
|
|
|
desc: Pull latest docker images
|
|
|
|
cmds:
|
2022-12-10 18:16:50 +01:00
|
|
|
- "docker-compose {{.COMPOSE_ARGS}} pull {{.CLI_ARGS}}"
|
2022-11-13 01:10:26 +01:00
|
|
|
|
|
|
|
build:
|
|
|
|
desc: Build latest docker images (if applicable)
|
|
|
|
cmds:
|
2022-12-10 18:16:50 +01:00
|
|
|
- "docker-compose {{.COMPOSE_ARGS}} build {{.CLI_ARGS}}"
|
2022-11-13 01:10:26 +01:00
|
|
|
|
|
|
|
up:
|
|
|
|
desc: Deploy given or active services
|
|
|
|
deps:
|
2022-12-10 18:16:50 +01:00
|
|
|
- util:template
|
2022-11-13 01:10:26 +01:00
|
|
|
cmds:
|
2022-12-10 18:16:50 +01:00
|
|
|
- "docker-compose {{.COMPOSE_ARGS}} up -d {{.CLI_ARGS}}"
|
2022-11-13 01:10:26 +01:00
|
|
|
|
|
|
|
restart:
|
|
|
|
desc: Restart given or active services
|
|
|
|
deps:
|
2022-12-10 18:16:50 +01:00
|
|
|
- util:template
|
2022-11-13 01:10:26 +01:00
|
|
|
cmds:
|
2022-12-10 18:16:50 +01:00
|
|
|
- "docker-compose {{.COMPOSE_ARGS}} restart {{.CLI_ARGS}}"
|
2022-11-13 01:10:26 +01:00
|
|
|
|
2023-08-23 20:53:27 +02:00
|
|
|
recreate:
|
|
|
|
desc: Recreate given or active services
|
|
|
|
deps:
|
|
|
|
- util:template
|
|
|
|
cmds:
|
2023-09-09 16:01:23 +02:00
|
|
|
- "docker-compose {{.COMPOSE_ARGS}} up -d --force-recreate {{.CLI_ARGS}}"
|
2023-08-23 20:53:27 +02:00
|
|
|
|
2022-11-13 01:10:26 +01:00
|
|
|
stop:
|
|
|
|
desc: Stop given or all services
|
|
|
|
cmds:
|
2022-12-10 18:16:50 +01:00
|
|
|
- "docker-compose {{.COMPOSE_ARGS}} stop {{.CLI_ARGS}}"
|
2022-11-13 01:10:26 +01:00
|
|
|
|
|
|
|
down:
|
|
|
|
desc: Stop and remove all services
|
|
|
|
cmds:
|
2022-12-10 18:16:50 +01:00
|
|
|
- "docker-compose {{.COMPOSE_ARGS}} down"
|
2022-11-13 01:10:26 +01:00
|
|
|
|
|
|
|
logs:
|
|
|
|
desc: Tail logs of given or all services
|
|
|
|
deps:
|
2022-12-10 18:16:50 +01:00
|
|
|
- util:template
|
2022-11-13 01:10:26 +01:00
|
|
|
cmds:
|
2022-12-10 18:16:50 +01:00
|
|
|
- "docker-compose {{.COMPOSE_ARGS}} logs --tail=50 --follow {{.CLI_ARGS}}"
|
2022-11-13 01:10:26 +01:00
|
|
|
|
|
|
|
upgrade:
|
|
|
|
desc: Pull and re-deploy active services
|
|
|
|
cmds:
|
|
|
|
- task: pull
|
|
|
|
- task: up
|
2022-12-10 18:16:50 +01:00
|
|
|
|
|
|
|
list:
|
|
|
|
desc: List current containers
|
|
|
|
cmds:
|
2022-12-11 23:24:48 +01:00
|
|
|
- docker ps -a --format 'table {{"{{.ID}}"}}\t{{"{{.Image}}"}}\t{{"{{.Names}}"}}\t{{"{{.CreatedAt}}"}}\t{{"{{.Status}}"}}\t{{"{{.Networks}}"}}'
|
2023-02-18 15:25:31 +01:00
|
|
|
|
|
|
|
uplogs:
|
|
|
|
desc: up & logs
|
|
|
|
cmds:
|
|
|
|
- task: up
|
|
|
|
- task: logs
|