-
Notifications
You must be signed in to change notification settings - Fork 87
/
generate.sh
executable file
·46 lines (40 loc) · 1.07 KB
/
generate.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
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function generateDocs {
echo "generating $1 - $2"
git checkout docs/$2/generated
rm -rf docs/$2/cache
mkdir docs/$2/cache
rm -rf docs/$2/generated
mkdir docs/$2/generated
cd piwik
git rm --cached -r . > /dev/null
git reset --hard > /dev/null
git submodule foreach --recursive git reset --hard
git clean -f -d
git submodule foreach git clean -f
git fetch
git checkout $1
branchname=$(git rev-parse --abbrev-ref HEAD)
if [ "$branchname" != "$1" ]; then
echo "Not on correct branch"
return
fi
sleep 4
git rev-parse --abbrev-ref HEAD
git pull origin $1
sleep 3
git submodule update --init --recursive --force
php ../app/composer.phar self-update
php ../app/composer.phar install
cd ..
sleep 10
php generator/generate.php --branch=$1 --targetname=$2
GENERATION_SUCCESS=$?
if [ $GENERATION_SUCCESS -ne 0 ]; then
exit 1;
fi
}
cd $DIR
generateDocs "5.x-dev" "5.x"
rm -rf app/tmp/cache/*