forked from b-n-space/0l-operations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
67 lines (56 loc) · 1.73 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
59
60
61
62
63
64
65
66
67
version: '3'
vars:
# Extracts values from .env file
IMAGE:
sh: grep -v '^#' .env | grep -e "OL_IMAGE" | sed -e 's/.*=//'
REPO:
sh: grep -v '^#' .env | grep -e "OL_REPO" | sed -e 's/.*=//'
BRANCH:
sh: grep -v '^#' .env | grep -e "OL_BRANCH" | sed -e 's/.*=//'
tasks:
docker:build:
desc: "Build docker images"
cmds:
- docker build --build-arg BRANCH={{.BRANCH}} --build-arg REPO={{.REPO}} --tag {{.IMAGE}} .
- task docker:build:source
- task docker:build:builder
docker:build:source:
desc: "Build docker [source] image"
cmds:
- docker build --build-arg BRANCH={{.BRANCH}} --build-arg REPO={{.REPO}} --tag {{.IMAGE}}-source --target source .
docker:build:builder:
desc: "Build docker [builder] image"
cmds:
- docker build --build-arg BRANCH={{.BRANCH}} --build-arg REPO={{.REPO}} --tag {{.IMAGE}}-builder --target builder .
docker:push:
desc: "Push docker image"
cmds:
- docker push {{.IMAGE}}
docker:push:source:
desc: "Push docker [source] image"
cmds:
- docker push {{.IMAGE}}-source
docker:push:builder:
desc: "Push docker [builder] image"
cmds:
- docker push {{.IMAGE}}-builder
shell:
desc: "Start a shell container"
cmds:
- docker compose up -d shell
- docker compose exec shell bash
source:
desc: "Start a source container"
cmds:
- docker compose up -d source
- docker compose exec source bash
builder:
desc: "Start a builder container"
cmds:
- docker compose up -d builder
- docker compose exec builder bash
clean-utils:
desc: "Clean utility containers"
cmds:
- docker compose stop shell source builder
- docker compose rm shell source builder