Remove unused code from Makefile

This commit is contained in:
2015-12-05 21:34:03 +01:00
parent 22a562e450
commit 2a05f52450

View File

@@ -5,7 +5,6 @@ FILE = $(BASE)/Dockerfile
TMP = /opt/tmp
FROM = ubuntu:trusty
INTERFACE = eth0
PORT = 8000
MODE = normal
ARGS = --rm=false --no-cache=false
include $(wildcard $(HOME)/build/make/*.mk)
@@ -42,51 +41,21 @@ build: prepare base
$(call script,cleanup)
@echo 'RUN chmod +x /opt/init.d/*' >> ${FILE}
@echo 'CMD ["/opt/init"]' >> ${FILE}
@$(shell cd ${BASE} && python -m SimpleHTTPServer $(PORT) > /dev/null &)
@docker build -t $(NAME):$(VERSION) $(ARGS) ${BASE}
@kill -9 $(lsof -i tcp:$(PORT) -t)
prepare:
@echo FROM $(FROM) > ${FILE}
@echo ENV MODE $(MODE) >> ${FILE}
@$(eval HOST_ADDR := $(shell ifconfig $(INTERFACE) | grep 'inet addr:' | cut -d: -f2 | awk '{print $$1}'))
@echo ENV HOST_ADDR $(HOST_ADDR) >> ${FILE}
@echo ENV HOST_PORT $(PORT) >> ${FILE}
@echo 'RUN apt-get install -y wget' >> ${FILE}
$(call add,config,/build/config)
$(call add,init,/opt/init)
@echo 'RUN chmod +x /opt/init' >> ${FILE}
$(call script,prepare)
service:
@if test "${DEPENDS}" != ""; then \
echo start on started docker-$(subst $(eval) $(eval), and started docker-,$(DEPENDS)) >> init.conf ;\
echo stop on stopped docker-$(subst $(eval) $(eval), or stopped docker-,$(DEPENDS)) >> init.conf ;\
else \
echo start on started docker >> init.conf ;\
echo stop on stopped docker >> init.conf ;\
fi
@echo exec /opt/docker/bin/run $(NAME) >> init.conf
@echo respawn >> init.conf
@mv init.conf /etc/init/docker-$(NAME).conf
bin:
@rm -r bin
@mkdir -p bin
@ln -sf $(BASE)/bin/run bin
@ln -sf $(BASE)/bin/ssh bin
@ln -sf $(BASE)/bin/app bin
@sed -i "1iARGS=\"$(RUN)\"" bin/run
@sed -i "1iARGS=\"$(SSH)\"" bin/ssh
clean:
@rm -f ${FILE}
@rm -rf build
@rm -rf id_rsa
tag_latest:
@docker tag $(NAME):$(VERSION) $(NAME):latest
ssh:
@ID=$$(docker ps | grep "$(NAME):$(VERSION)" | awk '{ print $$1 }') && \
if test "$$ID" = ""; then echo "Container is not running."; exit 1; fi && \