-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
74 lines (65 loc) · 2.28 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
68
69
70
71
72
73
74
version: '3'
dotenv: [.env]
tasks:
migrate:
cmds:
- |
echo $DB_USERNAME
echo $DB_HOST:$DB_PORT
export GOOSE_DBSTRING="$DB_USERNAME:$DB_PASSWORD@tcp($DB_HOST:$DB_PORT)/$DB_NAME?parseTime=true"
goose -dir init mysql {{.CLI_ARGS}}
echo $(goose -dir init mysql status)
ecr-login:
cmds:
- aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin "$(aws sts get-caller-identity --query Account --output text).dkr.ecr.ap-northeast-2.amazonaws.com"
build-app-image:
vars:
BUILD_TAG:
sh: git rev-parse --short=10 HEAD
cmds:
- docker build --target server -t {{.APP_NAME}}:{{.BUILD_TAG}} --build-arg APP_NAME={{.APP_NAME}} --build-arg APP_PORT=$APP_PORT --build-arg BUILD_TAG={{.BUILD_TAG}} .
build-migration-image:
vars:
BUILD_TAG:
sh: git rev-parse --short=10 HEAD
cmds:
- docker build --platform linux/arm64 --target migration -t migration:{{.BUILD_TAG}} .
push-image:
vars:
BUILD_TAG:
sh: git rev-parse --short=10 HEAD
cmds:
- docker tag {{.APP_NAME}}:{{.BUILD_TAG}} $(aws sts get-caller-identity --query Account --output text).dkr.ecr.ap-northeast-2.amazonaws.com/{{.APP_NAME}}:{{.BUILD_TAG}}
- docker push $(aws sts get-caller-identity --query Account --output text).dkr.ecr.ap-northeast-2.amazonaws.com/{{.APP_NAME}}:{{.BUILD_TAG}}
build-all:
cmds:
- task: build-app-image
vars: {APP_NAME: "car"}
- task: build-app-image
vars: {APP_NAME: "hotel"}
- task: build-app-image
vars: {APP_NAME: "flight"}
- task: build-app-image
vars: {APP_NAME: "saga"}
- task: build-app-image
vars: {APP_NAME: "trip"}
- task: build-app-image
vars: {APP_NAME: "relay"}
- task: build-migration-image
push-all:
deps: [ecr-login]
cmds:
- task: push-image
vars: {APP_NAME: "car"}
- task: push-image
vars: {APP_NAME: "hotel"}
- task: push-image
vars: {APP_NAME: "flight"}
- task: push-image
vars: {APP_NAME: "saga"}
- task: push-image
vars: {APP_NAME: "trip"}
- task: push-image
vars: {APP_NAME: "relay"}
- task: push-image
vars: {APP_NAME: "migration"}