Skip to content

Commit e1c3553

Browse files
committed
Improve make dist zip task fc2blog#39 fc2blog#233
- Change create filename, remove commit id from filename. - Generate and add `app/version` file. - Add build/test-no-pushed-branch task that not be require pushed branch when build.
1 parent 72168ea commit e1c3553

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

dist_zip/Makefile

+26-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,43 @@
11
.PHONY:
22
build:
33
make clean
4-
git clone --depth=1 --branch=`git branch --contains |cut -d " " -f 2` https://github.com/uzulla/fc2blog.git fc2blog
4+
git clone --depth=1 --branch=`git branch --contains |cut -d " " -f 2| sed '/^$/d'` https://github.com/uzulla/fc2blog.git fc2blog
55
rm -rf fc2blog/.git
66
cd fc2blog && php ../../composer.phar install --no-dev --optimize-autoloader
7-
cd fc2blog && zip -r ../fc2blog_dist_`git rev-parse --short HEAD`.zip app public
7+
# get tag from current commit id.
8+
git tag -l --contains `git show -s --format=%H` > fc2blog/app/version
9+
# Set "dev" to contents/version, If contents/version is zero size file.
10+
if [ ! -s fc2blog/app/version ]; then echo "dev:"`git branch --contains |cut -d " " -f 2 | grep -e '.'`":"`git rev-parse --short HEAD` > fc2blog/app/version; fi
11+
cd fc2blog && zip -r ../fc2blog_dist.zip app public
12+
13+
.PHONY:
14+
build-no-pushed-branch:
15+
make clean
16+
mkdir fc2blog
17+
cp -a ../app ../public ../composer.json ../composer.lock fc2blog
18+
-rm fc2blog/app/temp/installed.lock
19+
cd fc2blog && php ../../composer.phar install --no-dev --optimize-autoloader
20+
rm fc2blog/composer.*
21+
echo "dev:"`git branch --contains |cut -d " " -f 2 | grep -e '.'`":"`git rev-parse --short HEAD` > fc2blog/app/version
22+
cd fc2blog && zip -r ../fc2blog_dist.zip app public
823

924
.PHONY:
1025
clean:
1126
-rm -rf fc2blog
12-
-rm fc2blog_dist_*
27+
-rm fc2blog_dist.zip
1328
-rm test_vm/fc2blog_dist.zip
1429
-rm test_vm/fc2blog_installer.php
1530

1631
.PHONY:
1732
test:
1833
make build
19-
cp fc2blog_dist_`git -C fc2blog rev-parse --short HEAD`.zip test_vm/fc2blog_dist.zip
34+
cp fc2blog_dist.zip test_vm/fc2blog_dist.zip
35+
cp installer/fc2blog_installer.php test_vm/fc2blog_installer.php
36+
cd test_vm && make image && make bash
37+
38+
.PHONY:
39+
test-no-pushed-branch:
40+
make build-no-pushed-branch
41+
cp fc2blog_dist.zip test_vm/fc2blog_dist.zip
2042
cp installer/fc2blog_installer.php test_vm/fc2blog_installer.php
2143
cd test_vm && make image && make bash

0 commit comments

Comments
 (0)