[minor] add version to agent RPM build

This commit is contained in:
Julien Vehent 2014-06-11 17:19:52 -04:00
Родитель ec6e2e8764
Коммит 824e52f82f
1 изменённых файлов: 10 добавлений и 9 удалений

Просмотреть файл

@ -4,7 +4,9 @@
BUILDREF := $(shell git log --pretty=format:'%h' -n 1)
BUILDDATE := $(shell date +%Y%m%d%H%M)
BUILDREV := $(BUILDREF)-$(BUILDDATE)
BUILDREV := $(BUILDDATE)_$(BUILDREF)
BUILDENV := dev
BUILDDC := local
# Supported OSes: linux darwin freebsd windows
# Supported ARCHes: 386 amd64
@ -82,7 +84,6 @@ go_get_deps:
$(GOGETTER) bitbucket.org/kardianos/osext
$(GOGETTER) bitbucket.org/kardianos/service
install: gpgme mig-agent mig-scheduler
$(INSTALL) -D -m 0755 $(BINDIR)/mig-agent $(DESTDIR)$(PREFIX)/sbin/mig-agent
$(INSTALL) -D -m 0755 $(BINDIR)/mig-scheduler $(DESTDIR)$(PREFIX)/sbin/mig-scheduler
@ -99,11 +100,11 @@ rpm-agent: mig-agent
$(INSTALL) -D -m 0755 $(BINDIR)/mig-agent-$(BUILDREV) tmp/sbin/mig-agent-$(BUILDREV)
$(MKDIR) -p tmp/var/cache/mig
# Agent auto install startup scripts, so we just need to execute it once as priviliged user
echo -en "#!/bin/sh\nrm /sbin/mig-agent\nln -s /sbin/mig-agent-$(BUILDREV) /sbin/mig-agent\n/sbin/mig-agent" > tmp/agent_install.sh
echo -en "#!/bin/sh\nset -e\n[ -e /sbin/mig-agent ] && rm /sbin/mig-agent\nln -s /sbin/mig-agent-$(BUILDREV) /sbin/mig-agent\n/sbin/mig-agent" > tmp/agent_install.sh
chmod 0755 tmp/agent_install.sh
fpm -C tmp -n mig-agent --license GPL --vendor mozilla --description "Mozilla InvestiGator Agent" \
--url https://github.com/mozilla/mig --after-install tmp/agent_install.sh \
-s dir -t rpm .
-v $(BUILDREV)_$(BUILDDC)_$(BUILDENV) -s dir -t rpm .
deb-agent: mig-agent
# Bonus FPM options
@ -112,11 +113,11 @@ deb-agent: mig-agent
$(INSTALL) -D -m 0755 $(BINDIR)/mig-agent-$(BUILDREV) tmp/sbin/mig-agent-$(BUILDREV)
$(MKDIR) -p tmp/var/cache/mig
# Agent auto install startup scripts, so we just need to execute it once as priviliged user
echo -en "#!/bin/sh\nrm /sbin/mig-agent\nln -s /sbin/mig-agent-$(BUILDREV) /sbin/mig-agent\n/sbin/mig-agent" > tmp/agent_install.sh
echo -en "#!/bin/sh\nset -e\n[ -e /sbin/mig-agent ] && rm /sbin/mig-agent\nln -s /sbin/mig-agent-$(BUILDREV) /sbin/mig-agent\n/sbin/mig-agent" > tmp/agent_install.sh
chmod 0755 tmp/agent_install.sh
fpm -C tmp -n mig-agent --license GPL --vendor mozilla --description "Mozilla InvestiGator Agent" \
--url https://github.com/mozilla/mig --after-install tmp/agent_install.sh \
-s dir -t deb .
-v $(BUILDREV)_$(BUILDDC)_$(BUILDENV) -s dir -t deb .
rpm-scheduler: mig-scheduler
rm -rf tmp