fpm/Makefile

74 lines
1.7 KiB
Makefile
Raw Permalink Normal View History

2012-03-01 00:55:36 +08:00
GEMSPEC=$(shell ls *.gemspec)
2012-11-27 13:55:29 +08:00
VERSION=$(shell awk -F\" '/VERSION =/ { print $$2 }' lib/fpm/version.rb)
2012-03-01 00:55:36 +08:00
NAME=$(shell awk -F\" '/spec.name/ { print $$2 }' $(GEMSPEC))
GEM=$(NAME)-$(VERSION).gem
.PHONY: test
test:
2012-03-01 01:00:21 +08:00
rm -rf .yardoc
2013-10-30 05:30:44 +08:00
sh notify-failure.sh rspec
2012-03-01 00:55:36 +08:00
.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)
2012-03-04 09:36:44 +08:00
.PHONY:
clean:
2012-08-08 00:33:22 +08:00
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
2021-11-10 14:29:06 +08:00
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 .