-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (20 loc) · 783 Bytes
/
Makefile
File metadata and controls
25 lines (20 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
IMAGE = youdowell/php-fpm-for-wordpress
VERSION ?= snapshot
.PHONY: all build clean tag-latest release
all: build
build: image/$(VARIANT)
ifeq ($(VARIANT),)
docker build -t $(IMAGE):$(VERSION) --rm image
else
docker build -t $(IMAGE):$(VERSION)-$(VARIANT) --rm image/$(VARIANT)
endif
tag-latest:
ifeq ($(VARIANT),)
docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest
else
docker tag -f $(IMAGE):$(VERSION)-$(VARIANT) $(IMAGE):$(VARIANT)
endif
release: tag-latest
@if ! docker images $(IMAGE) | awk '{ print $$2 }' | grep -q -F $(VERSION)-$(VARIANT); then echo "$(IMAGE) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
docker push $(IMAGE)
@echo "*** Don't forget to create a tag. git tag v$(VERSION) -m "$(VERSION)" && git push origin v$(VERSION)"