-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yml
53 lines (44 loc) · 1.08 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
default:
desc: Docker Controler
cmds:
- echo "run $task -l"
build-run:
desc: Build and Run.
cmds:
- task: build
- echo
- task: run
- echo
- task: ps
build:
desc: Docker Build
cmds:
- docker build -t {{.DOCKER_IMAGE}}:{{.DOCKER_TAG}} {{.DOCKER_FILE}}
run:
desc: Dokcer run
cmds:
- docker run {{.DOCKER_OPTS}} {{.DOCKER_IMAGE}}:{{.DOCKER_TAG}}
ps:
desc: Dokcer ps for {{.DOCKER_IMAGE}}
cmds:
- docker ps | awk '$0 ~ /{{.DOCKER_IMAGE}}/'
stop:
desc: Dokcer stop
cmds:
- docker stop $(docker ps | awk '$0 ~ /{{.DOCKER_IMAGE}}/ {print $1}')
silent: true
shell:
desc: Get into a container
cmds:
- docker exec -it $(docker ps | awk '$0 ~ /{{.DOCKER_IMAGE}}/ {print $1}') {{.command}}
vars:
command: bash
rmi:
desc: Delete Dokcer image
cmds:
- docker rmi {{.DOCKER_IMAGE}} && echo
backup_file:
desc: backup
cmds:
- install -d {{.BACKUP_DIR}}/{{now | date "060102_1504"}}
- docker cp $(docker ps | awk '$0 ~ /{{.DOCKER_IMAGE}}/ {print $1}'):{{.BAKCUP_FILE}} {{.BACKUP_DIR}}/{{now | date "060102_1504"}}/