container-server/tasks/services.yml

38 lines
1,012 B
YAML
Raw Normal View History

version: "3"
vars:
TMP_DIR: /tmp/container-server
tasks:
mc-update:
desc: update minecraft mods
cmds:
- "docker exec -it -u amp -w /home/amp/.ampdata/instances/Main/Minecraft minecraft bash update_all.sh"
caddy-reload:
desc: Reload Caddy config
cmds:
- "docker exec -w /etc/caddy proxy caddy reload"
mail-setup:
desc: Docker-Mailserver setup utility
cmds:
- "docker exec mail setup {{.CLI_ARGS}}"
psql-dump:
desc: Dump postgres database for backup or update
cmds:
- mkdir -p {{.TMP_DIR}}
- docker exec pg-{{.CLI_ARGS}} pg_dumpall -U {{.CLI_ARGS}} > {{.TMP_DIR}}/{{.CLI_ARGS}}.sql
- ls -la {{.TMP_DIR}}/{{.CLI_ARGS}}.sql
psql-restore:
desc: Load postgres database for restore
cmds:
- docker exec pg-{{.CLI_ARGS}} psql --echo-errors -U {{.CLI_ARGS}} -d {{.CLI_ARGS}} < {{.TMP_DIR}}/{{.CLI_ARGS}}.sql
psql-clear-tmp:
desc: Clear temporary sql files created by psql-dump
cmds:
- rm -rv {{.TMP_DIR}}