compilar todas las gemas binarias

This commit is contained in:
f 2021-01-05 12:01:19 -03:00
parent 475cb970bc
commit 3a3b39a2ac

View file

@ -39,14 +39,16 @@ load:
mkdir -p $@ mkdir -p $@
gem_dir := $(shell readlink -f ../gems) gem_dir := $(shell readlink -f ../gems)
gem_cache_dir := $(gem_dir)/cache
gem_binary_dir := $(gem_dir)/$(alpine_version)
ifeq ($(MAKECMDGOALS),build-gems) ifeq ($(MAKECMDGOALS),build-gems)
gems := $(shell bundle show --paths | xargs -I {} sh -c 'test -f {}/ext/*/extconf.rb && basename {}') gems := $(shell bundle show --paths | xargs -I {} sh -c 'find {}/ext/ -name extconf.rb &>/dev/null && basename {}')
gems += $(shell bundle show --paths | xargs -I {} sh -c 'test -f {}/ext/extconf.rb && basename {}') gems := $(patsubst %-x86_64-linux,%,$(gems))
gems := $(patsubst %,$(gem_dir)/cache/%.gem,$(gems)) gems := $(patsubst %,$(gem_cache_dir)/%.gem,$(gems))
gems_musl := $(patsubst $(gem_dir)/cache/%.gem,$(gem_dir)/$(alpine_version)/%-x86_64-linux-musl.gem,$(gems)) gems_musl := $(patsubst $(gem_cache_dir)/%.gem,$(gem_binary_dir)/%-x86_64-linux-musl.gem,$(gems))
endif endif
$(gem_dir)/%-x86_64-linux-musl.gem: $(gem_binary_dir)/%-x86_64-linux-musl.gem:
@docker run \ @docker run \
-v $(gem_dir):/srv/gems \ -v $(gem_dir):/srv/gems \
-v `readlink -f ~/.ccache`:/home/builder/.ccache \ -v `readlink -f ~/.ccache`:/home/builder/.ccache \