-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
59 lines (49 loc) · 1.61 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
version: '3'
vars:
BASE_CMD: 'docker-compose'
# DEV_COMPOSE_FILE: 'docker-compose-develop.yml'
BACKEND_SERVICE: 'backend'
# FRONTEND_SERVICE: 'frontend'
BACKEND_CONTAINER_IMAGE: 'museum4punkt0-backend'
DB_SERVICE: 'db'
DB_PROGRAM: 'mysql'
DBDUMP_PROGRAM: 'mysqldump'
BACKEND_CONTAINER_ROOT: '/opt/app'
tasks:
dev:
desc: launch with docker-compose up
cmds:
- "{{ .BASE_CMD }} up"
build:
desc: build with docker-compose build
cmds:
- "{{ .BASE_CMD }} build --no-cache"
bash:
desc: bash on backend
cmds:
- "{{ .BASE_CMD }} exec {{ .BACKEND_SERVICE }} bash"
tar_uploads:
desc: make tar ball of public/uploads
cmds:
- "{{ .BASE_CMD }} exec {{ .BACKEND_SERVICE }} tar czvf uploads.tgz public/uploads"
- task cp_from -- uploads.tgz
generates:
- uploads.tgz
sql_prompt:
desc: run sql prompt of db
cmds:
- "{{ .BASE_CMD }} exec {{ .DB_SERVICE }} {{ .DB_PROGRAM }} -u strapi -p strapi"
sql_dump:
desc: make database dump
cmds:
- "{{ .BASE_CMD }} exec {{ .DB_SERVICE }} {{ .DBDUMP_PROGRAM }} -u strapi -p strapi > db.dump"
generates:
- db.dump
cp_from:
desc: copy file from backend
cmds:
- CONTAINER_ID=$(docker ps| grep {{ .BACKEND_CONTAINER_IMAGE }} | awk '{ print $1 }'); docker cp $CONTAINER_ID:{{ .BACKEND_CONTAINER_ROOT }}/{{ .CLI_ARGS }} {{ .CLI_ARGS }}
cp_to:
desc: copy file to backend
cmds:
- CONTAINER_ID=$(docker ps| grep {{ .BACKEND_CONTAINER_IMAGE }} | awk '{ print $1 }'); docker cp {{ .CLI_ARGS }} $CONTAINER_ID:{{ .BACKEND_CONTAINER_ROOT }}/{{ .CLI_ARGS }}