FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cakephp/Makefile at 5.x · cakephp/cakephp · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
cakephp
/
cakephp
Public
Notifications
You must be signed in to change notification settings
Fork
3.4k
Star
8.8k
Code
Issues
14
Pull requests
13
Actions
Projects
Wiki
Security and quality
6
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
cakephp
/
Makefile
Copy path
More file actions
More file actions
Latest commit
History
History
History
210 lines (173 loc) · 6.85 KB
Breadcrumbs
cakephp
/
Makefile
Copy path
File metadata and controls
210 lines (173 loc) · 6.85 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#
The following env variables need to be set:
#
- VERSION
#
- GITHUB_TOKEN personal access API token for github.
#
Use the version number to figure out if the release
#
is a pre-release
PRERELEASE
=
$(
shell
echo
$(
VERSION
)
| grep -E 'dev|rc|alpha|beta' --quiet && echo 'true' || echo 'false')
COMPONENTS
=cache console core collection container database datasource event filesystem form http i18n log ORM utility validation
CURRENT_BRANCH
=
$(
shell
git branch | grep '
*
' | tr -d '
*
')
#
Github settings
UPLOAD_HOST
=https://uploads.github.com
API_HOST
=https://api.github.com
OWNER
=cakephp
REMOTE
=origin
ifdef
GITHUB_TOKEN
AUTH=-H 'Authorization: token $(GITHUB_TOKEN)'
endif
DASH_VERSION
=
$(
shell
echo
$(
VERSION
)
| sed -e s/\\./-/g)
#
Used when building packages for older 3.x packages.
#
The build scripts clone cakephp/app, and this var selects the
#
correct tag in that repo.
#
For 3.1.x use 3.1.2
#
For 3.0.x use 3.0.5
APP_VERSION:
=5.x
#
The branch name of the 'next' branch that will also have package
#
splits updated during a release.
NEXT_BRANCH
=5.next
ALL
: help
help
:
@echo
"
CakePHP Makefile
"
@echo
"
================
"
@echo
"
"
@echo
"
release VERSION=x.y.z
"
@echo
"
Create a new release of CakePHP. Requires the VERSION and GITHUB_TOKEN parameter.
"
@echo
"
Packages up a new app skeleton tarball and uploads it to github.
"
@echo
"
"
@echo
"
package
"
@echo
"
Build the app package with all its dependencies.
"
@echo
"
"
@echo
"
publish
"
@echo
"
Publish the dist/cakephp-VERSION.zip to GitHub.
"
@echo
"
"
@echo
"
components
"
@echo
"
Split each of the public namespaces into separate repos and push the to GitHub.
"
@echo
"
Can be run with CURRENT_BRANCH=xx to split a specific branch.
"
@echo
"
"
@echo
"
clean-components CURRENT_BRANCH=xx
"
@echo
"
Delete branch xx from each subsplit. Useful when cleaning up after a security release.
"
@echo
"
"
@echo
"
test
"
@echo
"
Run the tests for CakePHP.
"
@echo
"
"
@echo
"
lint-src
"
@echo
"
Run php -l against every PHP file in src/.
"
@echo
"
"
@echo
"
All other tasks are not intended to be run directly.
"
.PHONY
: help
test
: install
vendor/bin/phpunit
.PHONY
: test
lint-src
:
@contrib/lint-php-src src
.PHONY
: lint-src
#
Utility target for checking required parameters
guard-
%
:
@if [
"
$(
$*
)
"
=
'
'
]
;
then
\
echo
"
Missing required
$*
variable.
"
;
\
exit
1
;
\
fi
;
#
Download composer
composer.phar
:
curl -sS https://getcomposer.org/installer
|
php
#
Install dependencies
install
: composer.phar
php composer.phar install
.PHONY
: install
#
Version bumping & tagging for CakePHP itself
#
Update VERSION.txt to new version.
bump-version
: guard-VERSION
@echo
"
Update VERSION.txt to
$(
VERSION
)
"
#
Work around sed being bad.
mv VERSION.txt VERSION.old
cat VERSION.old
|
sed s
'
/^[0-9]\.[0-9]\.[0-9].*/$(VERSION)/
'
>
VERSION.txt
rm VERSION.old
git add VERSION.txt
git commit -m
"
Update version number to
$(
VERSION
)
"
.PHONY
: bump-version
#
Tag a release
tag-release
: guard-VERSION bump-version
@echo
"
Tagging
$(
VERSION
)
"
git tag -s
$(
VERSION
)
-m
"
CakePHP
$(
VERSION
)
"
git push
$(
REMOTE
)
git push
$(
REMOTE
)
--tags
#
Tasks for tagging the app skeleton and
#
creating a zipball of a fully built app skeleton.
clean
:
rm -rf build
.PHONY
: clean
build
:
mkdir -p build
build/app
: build
git clone git@github.com:
$(
OWNER
)
/app.git build/app/
cd
build/app
&&
git checkout
$(
APP_VERSION
)
build/cakephp
: build
git checkout
$(
VERSION
)
git checkout-index -a -f --prefix=build/cakephp/
git checkout -
dist/cakephp-
$(
DASH_VERSION
)
.zip
: build/app build/cakephp composer.phar
mkdir -p dist
@echo
"
Installing app dependencies with composer
"
#
Install deps with composer
cd
build/app
&&
php ../../composer.phar install
&&
../../composer.phar run-script post-install-cmd --no-interaction
#
Copy the current cakephp libs up so we don't have to wait
#
for packagist to refresh.
rm -rf build/app/vendor/cakephp/cakephp
cp -r build/cakephp build/app/vendor/cakephp/cakephp
#
Make a zipball of all the files that are not in .git dirs
#
Including .git will make zip balls huge, and the zipball is
#
intended for quick start non-git, non-cli users
@echo
"
Building zipball for
$(
VERSION
)
"
cd
build/app
&&
find
.
-not -path
'
*.git*
'
|
zip ../../dist/cakephp-
$(
DASH_VERSION
)
.zip -@
#
Easier to type alias for zip balls
package
: clean dist/cakephp-
$(
DASH_VERSION
)
.zip
.PHONY
: package
#
Publish app skeleton with dependencies zipballs to Github.
publish
: guard-VERSION dist/cakephp-
$(
DASH_VERSION
)
.zip
@echo
"
Creating draft release for
$(
VERSION
)
. prerelease=
$(
PRERELEASE
)
"
curl
$(
AUTH
)
-XPOST
$(
API_HOST
)
/repos/
$(
OWNER
)
/cakephp/releases -d
'
{"tag_name": "$(VERSION)", "name": "CakePHP $(VERSION)", "draft": true, "prerelease": $(PRERELEASE)}
'
>
release.json
#
Extract id out of response json.
php -r
'
$$f = file_get_contents("./release.json"); $$d = json_decode($$f, true); file_put_contents("./id.txt", $$d["id"]);
'
@echo
"
Uploading zip file to github.
"
curl
$(
AUTH
)
-XPOST
\
$(
UPLOAD_HOST
)
/repos/
$(
OWNER
)
/cakephp/releases/
`
cat ./id.txt
`
/assets
?
name=cakephp-
$(
DASH_VERSION
)
.zip
\
-H
"
Accept: application/vnd.github.manifold-preview
"
\
-H
'
Content-Type: application/zip
'
\
--data-binary
'
@dist/cakephp-$(DASH_VERSION).zip
'
#
Cleanup files.
rm release.json
rm id.txt
.PHONY
: publish
#
Tasks for publishing separate repositories out of each CakePHP namespace
components
:
$(
foreach
component,
$(
COMPONENTS
)
, component-
$(
component
)
)
.PHONY
: components
components-tag
:
$(
foreach
component,
$(
COMPONENTS
)
, tag-component-
$(
component
)
)
.PHONY
: components-tag
component-
%
:
git checkout
$(
CURRENT_BRANCH
)
>
/dev/null
- (git remote add pkg-
$*
git@github.com:
$(
OWNER
)
/
$*
.git -f
2>
/dev/null)
- (git branch -D
$*
2>
/dev/null)
git branch
$*
$(
CURRENT_BRANCH
)
python3 contrib/git-filter-repo --subdirectory-filter src/
$(
shell
php -r "echo ucfirst('
$*
')
;
"
) --refs refs/heads/
$*
--force
git push -f pkg-
$*
$*
:
$(
CURRENT_BRANCH
)
tag-component-
%
: component-
%
guard-VERSION guard-GITHUB_TOKEN
@echo
"
Creating tag for the
$*
component
"
git checkout
$*
curl
$(
AUTH
)
-XPOST
$(
API_HOST
)
/repos/
$(
OWNER
)
/
$*
/git/refs -d
'
{"ref": "refs\/tags\/$(VERSION)", "sha": "$(shell git rev-parse $*)"}
'
git checkout
$(
CURRENT_BRANCH
)
>
/dev/null
make clean-component-branch-
$*
#
Task for cleaning up branches and remotes after updating split packages
clean-components-branches
:
$(
foreach
component,
$(
COMPONENTS
)
, clean-component-branch-
$(
component
)
)
.PHONY
: clean-components-branches
clean-component-branch-
%
:
git branch -D
$*
git remote rm pkg-
$*
#
Tasks for cleaning up branches created by security fixes to old branches.
components-clean
:
$(
foreach
component,
$(
COMPONENTS
)
, clean-component-
$(
component
)
)
clean-component-
%
:
- (git remote add pkg-
$*
git@github.com:
$(
OWNER
)
/
$*
.git -f
2>
/dev/null)
- (git branch -D
$*
2>
/dev/null)
- git push -f pkg-
$*
:
$(
CURRENT_BRANCH
)
.PHONY
: components-clean
#
Top level alias for doing a release.
release
: guard-VERSION lint-src tag-release components-tag package publish
.PHONY
: release
Back
|
FazBrowse Home
|
New Git URL