-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·47 lines (34 loc) · 1.31 KB
/
build.sh
File metadata and controls
executable file
·47 lines (34 loc) · 1.31 KB
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
#!/bin/bash
set -e
if ! [ -f phpdoc.phar ]; then
wget -q -O phpdoc.phar 'https://github.com/phpDocumentor/phpDocumentor/releases/latest/download/phpDocumentor.phar'
fi
sed -i -E '/^ (- url| start_path| edit_url):/d' antora-playbook.yml
echo " - url: ./" >> antora-playbook.yml
echo " start_path: docs" >> antora-playbook.yml
echo " edit_url: 'https://github.com/enginiro/docs/edit/{refname}/{path}'" >> antora-playbook.yml
mkdir -p build/site/phpdoc/
mkdir -p sources/
cd sources/
while read -r repository; do
[ -z "$repository" ] && continue
name="$(echo "$repository" | cut -d'/' -f2 | cut -d'.' -f1)"
if [ -d "$name" ]; then
cd "$name/"
git pull
cd ../
else
if [ "$GH_ENGINIRO_TOKEN" != "" ]; then
repository="$(echo "$repository" | sed "s%git@github.com:enginiro/%https://enginiro:$GH_ENGINIRO_TOKEN@github.com/enginiro/%")"
fi
git clone --depth 1 "$repository" --branch "main" --single-branch
fi
cd "$name/"
php ../../phpdoc.phar -t "../../build/site/phpdoc/$name/"
cd ../
echo " - url: ./sources/$name" >> ../antora-playbook.yml
echo " start_path: docs" >> ../antora-playbook.yml
echo " edit_url: 'https://github.com/enginiro/$name/edit/{refname}/{path}'" >> ../antora-playbook.yml
done < ../repositories
cd ..
./node_modules/.bin/antora generate --fetch antora-playbook.yml