forked from nextcloud/nextcloud-config-converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateConfig.sh
executable file
·45 lines (34 loc) · 1.15 KB
/
updateConfig.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
#!/bin/sh
# verbose and exit on error
set -xe
# import GPG keys
gpg --import /gpg/nextcloud-bot.public.asc
gpg --allow-secret-key-import --import /gpg/nextcloud-bot.asc
gpg --list-keys
currentDir=$(pwd)
if [[ -d /tmp/nextcloud-documentation ]]
then
rm -rf /tmp/nextcloud-documentation
fi
# fetch documentation repo
git clone git@github.com:nextcloud/documentation.git /tmp/nextcloud-documentation
cd /tmp/nextcloud-documentation
for branch in stable19 stable20 stable21 master
do
git checkout $branch
cd $currentDir
# download current version of config.sample.php
curl -o /tmp/config.sample.php https://raw.githubusercontent.com/nextcloud/server/$branch/config/config.sample.php
# use that to generate the documentation
php convert.php --input-file=/tmp/config.sample.php --output-file=/tmp/nextcloud-documentation/admin_manual/configuration_server/config_sample_php_parameters.rst
cd /tmp/nextcloud-documentation
# invokes an output if something has changed
status=$(git status -s)
if [ -n "$status" ]; then
echo "Push $branch"
git commit -am 'generate documentation from config.sample.php'
git push
fi
# cleanup
rm -rf /tmp/config.sample.php
done