forked from netz98/n98-magerun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·41 lines (29 loc) · 909 Bytes
/
build.sh
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
#!/usr/bin/env bash
#
# build from clean checkout
#
name="$(awk '/<project name="([^"]*)"/ && !done {print gensub(/<project name="([^"]*)".*/, "\\1", "g"); done=1}' build.xml
)"
phar="${name}.phar"
echo "building ${phar}..."
if [ ! -e "composer.phar" ]; then
wget http://getcomposer.org/composer.phar
chmod +x composer.phar
fi
if [ ! -d "vendor" ]; then
./composer.phar install
fi
if [ ! -d "build/vendor" ]; then
./composer.phar -d=build install
fi
ulimit -Sn $(ulimit -Hn)
php -f build/vendor/phing/phing/bin/phing -dphar.readonly=0 -- -verbose dist
BUILD_STATUS=$?
if [ ${BUILD_STATUS} -ne 0 ]; then
>&2 echo "error: phing build failed with exit status ${BUILD_STATUS}"
exit ${BUILD_STATUS}
fi
php -f build/phar/phar-timestamp.php
php -f "${phar}" -- --version
ls -l "${phar}"
php -r 'echo "SHA1: ", sha1_file("'"${phar}"'"), "\nMD5.: ", md5_file("'"${phar}"'"), "\n";'