This repository has been archived by the owner on Mar 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
/
Makefile
107 lines (93 loc) · 4.09 KB
/
Makefile
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# framework.zend.com Makefile
#
# Primary purpose is for updating the site to add releases.
#
# Also provides a target for updating the home page to capture new blog posts.
#
# Configurable variables:
# - PHP - path to PHP executable
# - VERSION - version being released or added to site; required for all but
# homepage target
# - RELEASE_DATE - release date in format Y-m-d, if other than current date
# - PORT - port on which to run built-in PHP web server
#
# Available targets:
# - homepage - update the homepage with latest feeds from blog and security
# advisories
# - all - add a release version, update manual and apidoc mappings, and update
# changelogs to include new version
# - serve - start an instance of the built-in PHP web server, given a default
# port of 8080 (but using PORT if provided)
VERSION ?= false
RELEASE_DATE ?= $(shell date +%F)
PHP ?= /usr/local/zend/bin/php
PORT ?= 8080
BIN = $(CURDIR)/bin
BLOG_FEED ?= $(CURDIR)/public/blog/feed-rss.xml
HOMEPAGE_PATH ?= $(CURDIR)/module/Application/view/application/index/index.phtml
HOMEPAGE_TEMPLATE ?= $(CURDIR)/data/homepage.phtml
SECURITY_CONFIG ?= $(CURDIR)/module/Security/config/module.config.php
.PHONY : all apidoc-version changelog check-version download-version homepage manual-version manual-latest-version
all : download-version manual-version manual-latest-version manual-route-version apidoc-version changelog homepage serve
homepage :
@echo "Updating homepage feeds..."
$(PHP) $(BIN)/update-homepage-feeds.php $(BLOG_FEED) $(SECURITY_CONFIG) $(HOMEPAGE_TEMPLATE) $(HOMEPAGE_PATH)
@echo "[DONE] Updating homepage feeds."
changelog : check-version
@echo "Updating changelog for version $(VERSION)..."
$(PHP) public/index.php changelog fetch --version=$(VERSION)
@echo "[DONE] Updating changelog."
download-version : check-version
@echo "Adding version $(VERSION) to release downloads..."
$(PHP) "$(BIN)/update-download-versions.php" $(VERSION) $(RELEASE_DATE) > module.downloads.global.php
ifeq ($$?,0)
@echo "[FAILED] Failed to generate download versions"
exit 1
endif
-mv module.downloads.global.php config/autoload/module.downloads.global.php
@echo "[DONE] Adding version to release downloads."
manual-version: check-version
@echo "Adding version $(VERSION) to manual mapping..."
$(PHP) $(BIN)/update-manual-versions.php $(VERSION) > zf$(VERSION_MAJOR)-manual-versions.php
ifeq ($$?,0)
@echo "[FAILED] Failed to generate manual version mapping"
exit 1
endif
-mv zf$(VERSION_MAJOR)-manual-versions.php config/autoload/zf$(VERSION_MAJOR)-manual-versions.php
@echo "[DONE] Adding manual version mapping."
manual-latest-version: check-version
ifeq ($(VERSION_MAJOR),2)
@echo "Updating manual downloads version to $(VERSION)..."
-cp module/Downloads/view/downloads/downloads/index.phtml.dist module/Downloads/view/downloads/downloads/index.phtml
-sed -i s/{VERSION}/$(VERSION)/g module/Downloads/view/downloads/downloads/index.phtml
@echo "[DONE] Updating manual downloads version"
endif
manual-route-version: check-version
@echo "Updating manual route default version to $(VERSION)..."
$(PHP) $(BIN)/update-manual-routes.php $(VERSION) > zf-manual-routes.global.php
ifeq ($$?,0)
@echo "[FAILED] Failed to update manual route default version"
exit 1
endif
-mv zf-manual-routes.global.php config/autoload/zf-manual-routes.global.php
@echo "[DONE] Updating manual route default version"
apidoc-version: check-version
@echo "Adding version $(VERSION) to apidoc mapping..."
$(PHP) $(BIN)/update-apidoc-versions.php $(VERSION) > zf-apidoc-versions.php
ifeq ($$?,0)
@echo "[FAILED] Failed to generate apidoc version mapping"
exit 1
endif
-mv zf-apidoc-versions.php config/autoload/zf-apidoc-versions.php
@echo "[DONE] Adding apidoc version mapping."
check-version :
ifeq ($(VERSION),false)
@echo "Missing VERSION assignment on commandline"
exit 1
endif
$(eval VERSION_MAJOR := $(shell echo $(VERSION) | cut -f1 -d.))
$(eval VERSION_MINOR := $(shell echo $(VERSION) | cut -f2 -d.))
serve :
@echo "Starting PHP built-in server on port $(PORT)"
$(PHP) -S 0.0.0.0:$(PORT) -t public/ public/index.php
@echo "[DONE] Shutting down PHP built-in server"