forked from jordansissel/fpm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (56 loc) · 1.69 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
GEMSPEC=$(shell ls *.gemspec)
VERSION=$(shell awk -F\" '/VERSION =/ { print $$2 }' lib/fpm/version.rb)
NAME=$(shell awk -F\" '/spec.name/ { print $$2 }' $(GEMSPEC))
GEM=$(NAME)-$(VERSION).gem
.PHONY: test
test:
rm -rf .yardoc
sh notify-failure.sh rspec
.PHONY: testloop
testloop:
while true; do \
$(MAKE) test; \
$(MAKE) wait-for-changes; \
done
.PHONY: serve-coverage
serve-coverage:
cd coverage; python -mSimpleHTTPServer
.PHONY: wait-for-changes
wait-for-changes:
-inotifywait --exclude '\.swp' -e modify $$(find $(DIRS) -name '*.rb'; find $(DIRS) -type d)
.PHONY: package
package: | $(GEM)
.PHONY: gem
gem: $(GEM)
$(GEM):
gem build $(GEMSPEC)
.PHONY: test-package
test-package: $(GEM)
# Sometimes 'gem build' makes a faulty gem.
gem unpack $(GEM)
rm -rf ftw-$(VERSION)/
.PHONY: publish
publish: test-package
gem push $(GEM)
.PHONY: install
install: $(GEM)
gem install $(GEM)
.PHONY:
clean:
rm -rf package-*/ *.rpm *.deb *.gz *.tar *.gem .yardoc/
publish-docs:
$(MAKE) -C docs publish
release-prep:
rm -f docs/changelog_links.rst docs/cli-reference.rst
make -C docs changelog_links.rst cli-reference.rst package-type-cli
# Testing in docker.
# The dot file is a sentinal file that will built a docker image, and tag it.
# The normal make target runs said image, mounting CWD against it.
SECONDARY: .docker-test-minimal .docker-test-everything
.docker-test-%: Gemfile.lock fpm.gemspec Dockerfile
DOCKER_BUILDKIT=1 docker build -t fpm-test-$* --build-arg BASE_ENV=$* --build-arg TARGET=test .
touch "$@"
docker-test-%: .docker-test-%
docker run -v `pwd`:/src fpm-test-$*
docker-release-%:
DOCKER_BUILDKIT=1 docker build -t fpm --build-arg BASE_ENV=$* --build-arg TARGET=release --squash .