forked from timescale/tsbs
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
64 lines (49 loc) · 1.89 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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOINSTALL=$(GOCMD) install
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
# DOCKER
DOCKER_APP_NAME=tsbs
DOCKER_ORG=redisbench
DOCKER_REPO:=${DOCKER_ORG}/${DOCKER_APP_NAME}
DOCKER_IMG:="$(DOCKER_REPO):$(DOCKER_TAG)"
DOCKER_LATEST:="${DOCKER_REPO}:latest"
.PHONY: all generators loaders runners
all: generators loaders runners
generators: tsbs_generate_data tsbs_generate_queries
loaders: tsbs_load_redistimeseries tsbs_load_cassandra tsbs_load_clickhouse tsbs_load_influx tsbs_load_mongo tsbs_load_siridb tsbs_load_timescaledb
runners: tsbs_run_queries_redistimeseries tsbs_run_queries_cassandra tsbs_run_queries_clickhouse tsbs_run_queries_influx tsbs_run_queries_mongo tsbs_run_queries_siridb tsbs_run_queries_timescaledb
test:
GO111MODULE=on $(GOTEST) -v -race -coverprofile=coverage.txt -covermode=atomic ./...
tsbs_%: $(wildcard ./cmd/$@/*.go)
$(GOGET) ./cmd/$@
$(GOBUILD) -o bin/$@ ./cmd/$@
$(GOINSTALL) ./cmd/$@
# DOCKER TASKS
# Build the container
docker-build:
docker build -t $(DOCKER_APP_NAME):latest -f docker/Dockerfile .
# Build the container without caching
docker-build-nc:
docker build --no-cache -t $(DOCKER_APP_NAME):latest -f docker/Dockerfile .
# Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR
docker-release: docker-build-nc docker-publish
# Docker publish
docker-publish: docker-publish-latest
## login to DockerHub with credentials found in env
docker-repo-login:
docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}
## Publish the `latest` tagged container to ECR
docker-publish-latest: docker-tag-latest
@echo 'publish latest to $(DOCKER_REPO)'
docker push $(DOCKER_LATEST)
# Docker tagging
docker-tag: docker-tag-latest
## Generate container `{version}` tag
docker-tag-latest:
@echo 'create tag latest'
docker tag $(DOCKER_APP_NAME) $(DOCKER_LATEST)