-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.vars
47 lines (38 loc) · 1.97 KB
/
Makefile.vars
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
PROJECT_ROOT := catalog
BUILD_PATH := bin
DOCKERFILE_PATH := $(CURDIR)/docker
# configuration for image names
USERNAME := $(USER)
GIT_COMMIT := $(shell git describe --dirty=-unsupported --always --tags || echo pre-commit)
IMAGE_VERSION ?= $(GIT_COMMIT)-$(USERNAME)
IMAGE_REGISTRY ?= infoblox
# configuration for server binary and image
SERVER_BINARY := $(BUILD_PATH)/server
SERVER_PATH := $(PROJECT_ROOT)/cmd/server
SERVER_IMAGE := $(IMAGE_REGISTRY)/catalog-server
SERVER_DOCKERFILE := $(DOCKERFILE_PATH)/Dockerfile
# configuration for the protobuf gentool
SRCROOT_ON_HOST := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
SRCROOT_IN_CONTAINER := /go/src/$(PROJECT_ROOT)
DOCKER_RUNNER := docker run -u `id -u`:`id -g` --rm
DOCKER_RUNNER += -v $(SRCROOT_ON_HOST):$(SRCROOT_IN_CONTAINER)
DOCKER_GENERATOR := infoblox/atlas-gentool:latest
GENERATOR := $(DOCKER_RUNNER) $(DOCKER_GENERATOR)
# configuration for the database
# user:password@/dbname?charset=utf8&parseTime=True&loc=Local
# $(DATABASE_USERNAME):$(DATABASE_PASSWORD)@$(DATABASE_ADDRESS)/$(DATABASE_NAME)?charset=utf8&parseTime=True&loc=Local
WITH_DATABASE = true
DATABASE_ADDRESS ?= localhost:3306
DATABASE_USERNAME ?= root
DATABASE_PASSWORD ?= ""
DATABASE_NAME = catalog
DATABASE_URL ?= # $(DATABASE_USERNAME):$(DATABASE_PASSWORD)@$(DATABASE_ADDRESS)/$(DATABASE_NAME)?charset=utf8&parseTime=True&loc=Local
MIGRATETOOL_IMAGE = infoblox/migrate:latest
MIGRATION_PATH_IN_CONTAINER = $(SRCROOT_IN_CONTAINER)/db/migrations
# configuration for building on host machine
GO_CACHE := -pkgdir $(BUILD_PATH)/go-cache
GO_BUILD_FLAGS ?= $(GO_CACHE) -i -v
GO_TEST_FLAGS ?= -v -cover
GO_PACKAGES := $(shell go list ./... | grep -v vendor)
#configuration for gateway
WITH_GATEWAY = true