Skip to content

Commit

Permalink
Build docs on rsync from git
Browse files Browse the repository at this point in the history
Closes GH-13.
  • Loading branch information
heiglandreas authored and nikic committed Jan 7, 2021
1 parent 60722bf commit 6643326
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 80 deletions.
4 changes: 2 additions & 2 deletions build-docs-lang-rsync
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ rm -rf html php output
date

echo "Running configure"
php /local/repos/phpdoc/doc-base/configure.php --with-lang=$1 --disable-libxml-check --disable-segfault-speed || exit 1
php /local/repos/phpdoc-git/doc-base/configure.php --with-lang=$1 --disable-libxml-check --disable-segfault-speed || exit 1
date

echo "Running test and build"
php /local/repos/phpdoc/phd/render.php --color false --package PHP --format php --format xhtml --format bigxhtml --format tocfeed -d /local/repos/phpdoc/doc-base/.manual.xml || exit 2
php /local/repos/phpdoc/phd/render.php --color false --package PHP --format php --format xhtml --format bigxhtml --format tocfeed -d /local/repos/phpdoc-git/doc-base/.manual.xml || exit 2
date

cd output
Expand Down
32 changes: 25 additions & 7 deletions build-docs-rsync
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,35 @@ GIT_RESET="git reset --quiet --hard origin/master"
cd /local/repos/phpdoc/phd
$GIT_FETCH && $GIT_RESET >/tmp/log-phd 2>&1

# Update docs sources
cd /local/repos/phpdoc
svn up >/tmp/log-svn 2>&1

# Build docs
BASE_DIR=/local/repos/phpdoc-git

assertUpToDateRepo() {
if [ ! -d $BASE_DIR/$1 ]; then
git clone https://git.php.net/repository/doc/$2.git $BASE_DIR/$1
fi
git -C $BASE_DIR/$1 fetch origin && git -C $BASE_DIR/$1 reset --hard origin/master > /tmp/log-git-$i 2>&1
}

langs=`php -r 'include "/local/mirrors/phpweb/include/languages.inc"; echo implode( " ", array_keys( $ACTIVE_ONLINE_LANGUAGES ) );'`;

if [ ! -d $BASE_DIR ]; then
mkdir $BASE_DIR;
fi

# Update the core module it self
assertUpToDateRepo doc-base base

# All translations depend on english being up2date
assertUpToDateRepo en en

cd $BASE_DIR

for i in $langs; do
# Update the translation files
/bin/bash /local/systems/build-docs-lang-rsync $i >>/tmp/log-$i 2>&1;
done;
# Update the translation files
assertUpToDateRepo $i $i
/bin/bash /local/systems/build-docs-lang-rsync $i >>/tmp/log-$i 2>&1;
done

# Build manual lookup db
php /local/systems/gen-phpweb-sqlite-db.php /local/mirrors/phpweb/backend/manual-lookup.sqlite /local/mirrors/phpweb /manual >/dev/null
Expand Down
5 changes: 4 additions & 1 deletion gen-phpweb-sqlite-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function scan($dir, $lang)
while (($f = readdir($d)) !== false) {

// Directories to skip
$skips = array('.svn', 'feeds', 'images', 'toc', '.', '..');
$skips = array('.git', '.svn', 'feeds', 'images', 'toc', '.', '..');
if (in_array($f, $skips)) {
continue;
}
Expand Down Expand Up @@ -184,6 +184,9 @@ function scan_langs($root)
if ($f === '.svn') {
continue;
}
if ($f === '.git') {
continue;
}
$file = $root . DIRECTORY_SEPARATOR . $f;

if (is_dir($file)) {
Expand Down
43 changes: 0 additions & 43 deletions rsync.php.net/build-docs-lang.sh

This file was deleted.

27 changes: 0 additions & 27 deletions rsync.php.net/build-docs.sh

This file was deleted.

0 comments on commit 6643326

Please sign in to comment.