Commit 65e8c7df authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Simplify Makefile

parent 7b384bef
......@@ -5,37 +5,31 @@ PATCHLEVEL=12
FULLVERSION=$(MAJOR).$(MINOR).$(PATCHLEVEL)
SHORTVERSION=$(MAJOR).$(MINOR)
.PHONY: all build_all \
build_php70 \
tag_latest release clean clean_images
.PHONY: \
all \
build \
release \
clean \
clean_images
all: build_all
all: build
build_all: \
build_php70
# Docker doesn't support sharing files between different Dockerfiles. -_-
# So we copy things around.
build_php70:
build:
rm -rf php70_image
cp -pR image php70_image
echo system.imageVersion=$(FULLVERSION) >> php70_image/config/bamboo/bamboo-capabilities.properties
echo final=1 >> php70_image/buildconfig
docker build -t $(NAME)-php70:$(FULLVERSION) --rm php70_image
docker tag $(NAME)-php70:$(FULLVERSION) $(NAME)-php70:$(SHORTVERSION)
tag_latest:
docker tag $(NAME)-php70:$(FULLVERSION) $(NAME)-php70:latest
release: tag_latest
release:
@if ! docker images $(NAME)-php70 | awk '{ print $$2 }' | grep -q -F $(FULLVERSION); then echo "$(NAME)-php70 version $(FULLVERSION) is not yet built. Please run 'make build'"; false; fi
docker tag $(NAME)-php70:$(FULLVERSION) $(NAME)-php70:$(SHORTVERSION)
docker tag $(NAME)-php70:$(FULLVERSION) $(NAME)-php70:latest
docker push $(NAME)-php70:latest
docker push $(NAME)-php70:$(FULLVERSION)
docker push $(NAME)-php70:$(SHORTVERSION)
# @echo "*** Don't forget to create a tag. git tag rel-$(FULLVERSION) && git push origin rel-$(FULLVERSION)"
clean:
rm -rf php70_image
clean_images:
docker rmi $(NAME)-php70:latest $(NAME)-php70:$(FULLVERSION) || true
docker rmi $(NAME)-php70:latest $(NAME)-php70:$(SHORTVERSION) $(NAME)-php70:$(FULLVERSION) || true
......@@ -15,9 +15,4 @@ rm -rf \
/usr/include/php/20151012/ext/apcu/ \
#
if [[ "$final" = 1 ]]; then
rm -rf /pd_build
else
rm -f /pd_build/{install,enable_repos,prepare,pups,nginx-passenger,finalize}.sh
rm -f /pd_build/{Dockerfile,insecure_key*}
fi
rm -rf /pd_build
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment