-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
40 lines (30 loc) · 1.06 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
REPO := alextanhongpin/go-github-scraper
VERSION := $(shell git rev-parse HEAD)
BUILD_DATE := $(shell date -R)
VCS_URL := $(shell basename `git rev-parse --show-toplevel`)
VCS_REF := $(shell git log -1 --pretty=%h)
NAME := $(shell basename `git rev-parse --show-toplevel`)
VENDOR := $(shell whoami)
SEMVER_VERSION := 1.1.0
include .env
start:
GITHUB_TOKEN=${GITHUB_TOKEN} DB_NAME=${DB_NAME} DB_HOST=${DB_HOST} DB_USER=${DB_USER} DB_PASS=${DB_PASS} go run main.go
mem:
@go tool pprof --alloc_space http://localhost:6060/debug/pprof/heap
# Collect a 30-seconds cpu profiling
cpu:
go tool pprof http://localhost:6060:/debug/pprof/profile
docker:
@docker build -t ${REPO} --build-arg VERSION="${VERSION}" \
--build-arg BUILD_DATE="${BUILD_DATE}" \
--build-arg VCS_URL="${VCS_URL}" \
--build-arg VCS_REF="${VCS_REF}" \
--build-arg NAME="${NAME}" \
--build-arg VENDOR="${VENDOR}" .
tag:
@docker tag ${REPO}:latest ${REPO}:${SEMVER_VERSION}
push:
@docker push ${REPO}:latest
@docker push ${REPO}:${SEMVER_VERSION}
production:
make docker && make tag && make push