-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (61 loc) · 2.03 KB
/
Makefile
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
75
# Run integration test
# need docker-compose and docker installed
integration-test:
docker-compose -f docker-compose.test.yaml up -d
sleep 10
go test -v ./...
docker-compose -f docker-compose.test.yaml down
# Run playground-ui on dev mode using npm
# need nodejs and npm installed
dev-ui:
cd playground-ui && npm install
cd playground-ui && npm run dev
# Run playground-ui on dev mode using yarn
# need nodejs and yarn installed
dev-ui-yarn:
cd playground-ui && yarn install
cd playground-ui && yarn run dev
# Export static site of playground-ui using npm
# need nodejs and npm installed
export-site:
cd playground-ui && npm run export
cd playground-ui && rm -rf public
cd playground-ui && cp -R __sapper__/export public
# Export static site of playground-ui using yarn
# need nodejs and yarn installed
export-site-yarn:
cd playground-ui && yarn run export
cd playground-ui && rm -rf public
cd playground-ui && cp -R __sapper__/export public
# run cakcuk service on dev mode
# need golang
dev:
go run cmd/main.go
# build cakcuk with an output of `main` binary file
# need golang
build:
CGO_ENABLED=1 go build cmd/main.go
build-ui:
cd playground-ui && npm run build
# make run BUILD_UI=true
run:
# optional build ui
@if [ -n "$(BUILD_UI)" ]; then make build-ui; fi
SLACK_TOKEN=${SLACK_TOKEN} \
SLACK_VERIFICATION_TOKEN=${SLACK_VERIFICATION_TOKEN} \
docker-compose -f docker-compose.yaml up --build --remove-orphans
# Read the contents of `loader.yaml` into a variable
# This is to simulate injecting `loader` via env
# You can also use file based by mounting it to `migration/yaml/loader.yaml`
LOADER := $$(cat ./migration/loader.yaml | base64)
# make run BUILD_UI=true
run-with-sqlite:
@# optional build ui
@if [ -n "$(BUILD_UI)" ]; then make build-ui; fi
@# remove sqlite db to start fresh
@rm -rf ./cakcuk.db
SLACK_TOKEN=${SLACK_TOKEN} \
SLACK_VERIFICATION_TOKEN=${SLACK_VERIFICATION_TOKEN} \
LOADER="${LOADER}" \
ALLOWED_CHANNELS=${ALLOWED_CHANNELS} \
docker-compose -f docker-compose.sqlite.yaml up --build --remove-orphans