-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·50 lines (37 loc) · 949 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
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
base=${PWD}
release=/tmp/recaptcha-release
rm -rf ${release}
mkdir ${release}
git archive --format zip --worktree-attributes HEAD > ${release}/release.zip
cd ${release}
unzip release.zip -d ./
rm release.zip
# Delete files
rm -rf ${release}/build.sh
# Install all Composer dependencies
composer install --prefer-dist --optimize-autoloader --ignore-platform-reqs --no-dev
cd "${release}/js"
if [ -f bower.json ]; then
bower install
fi
for app in forum admin; do
cd "${release}/js"
if [ -d $app ]; then
cd $app
if [ -f bower.json ]; then
bower install
fi
npm install
gulp --production
rm -rf node_modules bower_components
fi
done
rm -rf "${release}/extensions/${extension}/js/bower_components"
wait
# Finally, create the release archive
cd ${release}
find . -type d -exec chmod 0750 {} +
find . -type f -exec chmod 0644 {} +
chmod 0775 .
zip -r recaptcha.zip ./