forked from fc2blog/blog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
1 changed file
with
26 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,43 @@ | ||
.PHONY: | ||
build: | ||
make clean | ||
git clone --depth=1 --branch=`git branch --contains |cut -d " " -f 2` https://github.com/uzulla/fc2blog.git fc2blog | ||
git clone --depth=1 --branch=`git branch --contains |cut -d " " -f 2| sed '/^$/d'` https://github.com/uzulla/fc2blog.git fc2blog | ||
rm -rf fc2blog/.git | ||
cd fc2blog && php ../../composer.phar install --no-dev --optimize-autoloader | ||
cd fc2blog && zip -r ../fc2blog_dist_`git rev-parse --short HEAD`.zip app public | ||
# get tag from current commit id. | ||
git tag -l --contains `git show -s --format=%H` > fc2blog/app/version | ||
# Set "dev" to contents/version, If contents/version is zero size file. | ||
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 | ||
cd fc2blog && zip -r ../fc2blog_dist.zip app public | ||
|
||
.PHONY: | ||
build-no-pushed-branch: | ||
make clean | ||
mkdir fc2blog | ||
cp -a ../app ../public ../composer.json ../composer.lock fc2blog | ||
-rm fc2blog/app/temp/installed.lock | ||
cd fc2blog && php ../../composer.phar install --no-dev --optimize-autoloader | ||
rm fc2blog/composer.* | ||
echo "dev:"`git branch --contains |cut -d " " -f 2 | grep -e '.'`":"`git rev-parse --short HEAD` > fc2blog/app/version | ||
cd fc2blog && zip -r ../fc2blog_dist.zip app public | ||
|
||
.PHONY: | ||
clean: | ||
-rm -rf fc2blog | ||
-rm fc2blog_dist_* | ||
-rm fc2blog_dist.zip | ||
-rm test_vm/fc2blog_dist.zip | ||
-rm test_vm/fc2blog_installer.php | ||
|
||
.PHONY: | ||
test: | ||
make build | ||
cp fc2blog_dist_`git -C fc2blog rev-parse --short HEAD`.zip test_vm/fc2blog_dist.zip | ||
cp fc2blog_dist.zip test_vm/fc2blog_dist.zip | ||
cp installer/fc2blog_installer.php test_vm/fc2blog_installer.php | ||
cd test_vm && make image && make bash | ||
|
||
.PHONY: | ||
test-no-pushed-branch: | ||
make build-no-pushed-branch | ||
cp fc2blog_dist.zip test_vm/fc2blog_dist.zip | ||
cp installer/fc2blog_installer.php test_vm/fc2blog_installer.php | ||
cd test_vm && make image && make bash |