Commit d7c244b0 authored by Christian Kuhn's avatar Christian Kuhn Committed by Christian Kuhn
Browse files

[TASK] Simplify Makefile

parent b8057258
......@@ -5,37 +5,31 @@ PATCHLEVEL=0
FULLVERSION=$(MAJOR).$(MINOR).$(PATCHLEVEL)
SHORTVERSION=$(MAJOR).$(MINOR)
.PHONY: all build_all \
build_php56 \
tag_latest release clean clean_images
.PHONY: \
all \
build \
release \
clean \
clean_images
all: build_all
all: build
build_all: \
build_php56
# Docker doesn't support sharing files between different Dockerfiles. -_-
# So we copy things around.
build_php56:
build:
rm -rf php56_image
cp -pR image php56_image
echo system.imageVersion=$(FULLVERSION) >> php56_image/config/bamboo/bamboo-capabilities.properties
echo final=1 >> php56_image/buildconfig
docker build -t $(NAME)-php56:$(FULLVERSION) --rm php56_image
docker tag $(NAME)-php56:$(FULLVERSION) $(NAME)-php56:$(SHORTVERSION)
tag_latest:
docker tag $(NAME)-php56:$(FULLVERSION) $(NAME)-php56:latest
release: tag_latest
release:
@if ! docker images $(NAME)-php56 | awk '{ print $$2 }' | grep -q -F $(FULLVERSION); then echo "$(NAME)-php56 version $(FULLVERSION) is not yet built. Please run 'make build'"; false; fi
docker tag $(NAME)-php56:$(FULLVERSION) $(NAME)-php56:$(SHORTVERSION)
docker tag $(NAME)-php56:$(FULLVERSION) $(NAME)-php56:latest
docker push $(NAME)-php56:latest
docker push $(NAME)-php56:$(FULLVERSION)
docker push $(NAME)-php56:$(SHORTVERSION)
# @echo "*** Don't forget to create a tag. git tag rel-$(FULLVERSION) && git push origin rel-$(FULLVERSION)"
clean:
rm -rf php56_image
clean_images:
docker rmi $(NAME)-php56:latest $(NAME)-php56:$(FULLVERSION) || true
docker rmi $(NAME)-php56:latest $(NAME)-php56:$(SHORTVERSION) $(NAME)-php56:$(FULLVERSION) || true
......@@ -16,9 +16,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