forked from openebs-archive/jiva
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
90 lines (68 loc) · 2 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Makefile for building jiva docker image
#
# Reference Guide - https://www.gnu.org/software/make/manual/make.html
#
#
# Internal variables or constants.
# NOTE - These will be executed when any make target is invoked.
#
IS_GO_INSTALLED := $(shell which go >> /dev/null 2>&1; echo $$?)
IS_DOCKER_INSTALLED := $(shell which docker >> /dev/null 2>&1; echo $$?)
TARGETS := $(shell ls scripts)
help:
@echo ""
@echo "Usage:-"
@echo "\tmake build -- will create jiva image"
@echo "\tmake deps -- will verify build dependencies are installed"
@echo ""
_build_check_go:
@if [ $(IS_GO_INSTALLED) -eq 1 ]; \
then echo "" \
&& echo "ERROR:\tgo is not installed. Please install it before build." \
&& echo "" \
&& exit 1; \
fi;
_build_check_docker:
@if [ $(IS_DOCKER_INSTALLED) -eq 1 ]; \
then echo "" \
&& echo "ERROR:\tdocker is not installed. Please install it before build." \
&& echo "" \
&& exit 1; \
fi;
.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp
@@chmod +x .dapper.tmp
@./.dapper.tmp -v
@mv .dapper.tmp .dapper
$(TARGETS): .dapper
./.dapper $@
trash: .dapper
./.dapper -m bind trash
trash-keep: .dapper
./.dapper -m bind trash -k
deps: _build_check_go _build_check_docker trash
@echo ""
@echo "INFO:\tverifying dependencies for jiva ..."
_install_trash:
go get -u github.com/rancher/trash
_run_ci:
@echo ""
@echo "INFO:\t..... run ci over jiva image"
@echo ""
./ci/start_init_test.sh
_push_image:
cd $(GOPATH)/src/github.com/openebs/jiva && ./scripts/push
#
# Will build the go based binaries
# The binaries will be placed at $GOPATH/bin/
#
# build: deps _install_trash _fetch_longhorn _customize_longhorn _build_longhorn _run_ci _push_image
#
build: deps _install_trash ci _run_ci _push_image
#
# This is done to avoid conflict with a file of same name as the targets
# mentioned in this makefile.
#
.PHONY: help deps build $(TARGETS)
.DEFAULT_GOAL := build