-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (52 loc) · 1.69 KB
/
Makefile
File metadata and controls
64 lines (52 loc) · 1.69 KB
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
# Setup the platform
setup:
@echo "Generating env files..."
cp sample.env .env
cp sample.env test.env
@echo ".env & test.env created. Now, update values in them"
# Migrate database
migrate:
@echo "Running migrations..."
sh scripts/migrate.sh
# Run pretest script
pretest:
sh scripts/test-helper.sh
# Migrate Tests
migrate-test:
@echo "Running migrations for tests..."
sh scripts/migrate-tests.sh
# Run Tests
test-cover: migrate-test
go test `go list ./... | grep -v cmd` -coverprofile=/tmp/coverage.out -coverpkg=./...
go tool cover -html=/tmp/coverage.out
# Generate API documentation
doc:
@echo "Generating swagger docs..."
swag fmt --exclude ./internal/domain
swag init --parseDependency --parseInternal -g internal/http/api/app_api.go -ot go,yaml -o internal/http/swagger
# Connect dependencies
wire:
cd internal/dependency/ && wire && cd ../..
# Build the platform
build: migrate doc
@echo "Building app-api..."
sh scripts/build.sh
# Clean the platform
clean:
@echo "Cleaning up..."
rm ./bin/app || true
go clean -testcache
# Stop the platform
stop:
pkill app || true
# Start the platform
start: stop build
nohup ./bin/app &
# Start the services on docker
start-docker:
sh scripts/start-docker.sh
# Generate SDK
sdk-gen:
openapi-generator-cli generate -i internal/http/swagger/swagger.yaml --generator-name typescript-axios --config ./config/codegen.json -o ../app-sdk-ts
cp -r ./docs/sdk/templates/README.md ../app-sdk-ts/
cd ./../app-sdk-ts; git add .; git commit -m '${app_SDK_VERSION}: Regenerated models & apis'; npm version ${app_SDK_VERSION}; rm -rf dist node_modules; npm install; npm run build; npm publish; git add .; git commit -m '${app_SDK_VERSION}'; git push origin main