This repository has been archived by the owner on Oct 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
67 lines (49 loc) · 1.54 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
.PHONY: grimd publish test check clean run cover part ansible packer
# Copyright 2015 MediaMath <http://www.mediamath.com>. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
TIMESTAMP := $(shell date +"%s")
BUILD_TIME := $(shell date +"%Y%m%d.%H%M%S")
ARTIFACTORY_HOST = artifactory.mediamath.com
SHELL := /bin/bash
VERSION = $(strip $(TIMESTAMP))
ifndef REPOSITORY
REPOSITORY = libs-staging-global
endif
LDFLAGS = -ldflags "-X main.version=$(VERSION)-$(BUILD_TIME)"
ifdef VERBOSE
TEST_VERBOSITY=-v
else
TEST_VERBOSITY=
endif
grimd: dep
go build $(LDFLAGS) -o tmp/grimd github.com/MediaMath/grim/grimd
tmp/grimd-$(VERSION).zip: grimd | tmp
export PATH=$$PATH:$${GOPATH//://bin:}/bin; zip -r -j $@ tmp/grimd
test: dep
govendor test +local $(TEST_VERBOSITY)
part:
go get github.com/MediaMath/part
publish: part tmp/grimd-$(VERSION).zip
part -verbose -credentials=$(HOME)/.ivy2/credentials/$(ARTIFACTORY_HOST) -h="https://$(ARTIFACTORY_HOST)/artifactory" -r=$(REPOSITORY) -g=com.mediamath.grim -a=grimd -v=$(VERSION) tmp/grimd-$(VERSION).zip
packer: tmp/grimd-$(VERSION).zip
cp tmp/grimd-$(VERSION).zip provisioning/grimd.zip
packer push provisioning/grim.json
cover: tmp
cvr -o=tmp/coverage -short ./...
clean:
go clean ./...
rm -rf tmp/*
tmp:
mkdir tmp
check: test
go vet ./...
golint ./...
ansible:
cd ansible && ansible-playbook -i inventory site.xml
.PHONY: govendor
govendor:
go get -u github.com/kardianos/govendor
.PHONY:
dep: govendor
govendor sync