forked from blueboxgroup/ursula-monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (30 loc) · 1.23 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
NAME := ursula-monitoring
# If we're on an --exact-match tag, use it as the package version,
# with iteration '1', stripping any leading 'v'. Otherwise, break
# the git describe output of 'TAG-NN-gSHORTREF' into version 'TAG'
# and iteration 'NN.gSHORTREF'. See git-describe(1).
ARCH := all
VERSION := $(shell (git describe --exact-match || git describe --abbrev=0) 2>/dev/null | sed 's/^v//')
ITERATION := $(shell git describe --exact-match 2>/dev/null 1>/dev/null && echo 1 || git describe | perl -pe's/^[^-]+-//;s/-/./')
FPM_FLAGS := \
-s dir -a $(ARCH) -p build \
-v $(VERSION) --iteration $(ITERATION) \
--license 'Apache 2.0' \
--maintainer 'Blue Box, an IBM Company' \
--vendor 'Blue Box, an IBM Company' \
--url 'https://www.blueboxcloud.com/' \
--description 'Sensu plugins for ursula monitoring'
DEB := build/$(NAME)-sensu_$(VERSION)-$(ITERATION)_$(ARCH).deb
all: $(DEB)
$(DEB):
fpm -t deb $(FPM_FLAGS) -d sensu -n $(NAME)-sensu --deb-no-default-config-files \
sensu/plugins/=/opt/sensu/plugins
upload: repo_env all
package_cloud push $(PACKAGECLOUD_REPO)/ubuntu/trusty $(DEB)
.PHONY: clean repo_env
clean:
rm -f build/*
repo_env:
ifndef PACKAGECLOUD_REPO
$(error PACKAGECLOUD_REPO not set in your environment)
endif