-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (39 loc) · 1.36 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
# export these in your shell and run
# make with -e to override them
CGO_ENABLED=0
GOOS=linux
GOARCH=amd64
# build and dist output
bin_dir=.bin
# project nam and version
name=blueprint
version=0.1.0
# local build
install: build
sudo cp -f $(bin_dir)/$(name)-linux-$(GOARCH) /usr/local/bin/$(name)
build:
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) go build -a \
-ldflags '-X main.version=$(version) -X main.buildDate=$(shell date +%Y-%m-%d)' \
-o $(bin_dir)/$(name)-linux-$(GOARCH) \
./cmd/blueprint/
clean:
rm -rf $(bin_dir)
# docker image
image.build:
docker build \
--tag bluebrown/$(name):latest \
--tag bluebrown/$(name):$(version) \
--build-arg version=$(version) \
--build-arg buildDate=$(shell date +%Y-%m-%d) \
--file assets/docker/Dockerfile .
image.push:
docker push bluebrown/$(name):latest
docker push bluebrown/$(name):$(version)
# example
example.local: example.clean
go run ./cmd/blueprint/ assets/example/repo/ assets/myrepo --set service.enabled=false -f assets/example/v.yaml --values assets/example/v2.yaml
example.upstream: example.clean
go run ./cmd/blueprint/ https://github.com/bluebrown/$(name)-example assets/myrepo \
-f https://gist.githubusercontent.com/bluebrown/be3637e410f80b6c0eeeae5dc95ca662/raw/8be2a8e561463ac97448930a146bc0a9095616d4/$(name)-example-values.yaml
example.clean:
rm -rf assets/myrepo