Skip to content

Commit 355fe9e

Browse files
committed
Added file exclusions to elastisearch index generation.
1 parent 5131754 commit 355fe9e

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

Diff for: .dockerignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.dockerignore
2-
*Dockerfile*
1+
**/.git
2+
/build/

Diff for: Dockerfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ ENV DEBIAN_FRONTEND noninteractive
55
LABEL Description="This image is used to create an environment to contribute to the cakephp/docs"
66

77
RUN apt-get update && apt-get install -y \
8+
latexmk \
9+
openjdk-8-jdk \
10+
php \
811
python3-pip \
9-
texlive-latex-recommended \
10-
texlive-latex-extra \
1112
texlive-fonts-recommended \
1213
texlive-lang-all \
13-
latexmk \
14-
openjdk-8-jdk \
14+
texlive-latex-extra \
15+
texlive-latex-recommended \
1516
&& apt-get clean \
1617
&& rm -rf /var/lib/apt/lists/*
1718

Diff for: deploy.Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ ENV DEBIAN_FRONTEND noninteractive
55
LABEL Description="This image is used to create deployable images for book.cakephp.org"
66

77
RUN apt-get update && apt-get install -y \
8+
latexmk \
9+
php \
810
python3-pip \
9-
texlive-latex-recommended \
10-
texlive-latex-extra \
1111
texlive-fonts-recommended \
1212
texlive-lang-all \
13-
latexmk \
13+
texlive-latex-extra \
14+
texlive-latex-recommended \
1415
&& apt-get clean \
1516
&& rm -rf /var/lib/apt/lists/*
1617

Diff for: scripts/populate_search_index.php

+18-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
define('ES_INDEX', 'documentation');
1212
define('CAKEPHP_VERSION', '4-0');
1313

14+
// file exclusion patterns
15+
const FILE_EXCLUSIONS = [
16+
'/404\.rst$/',
17+
];
18+
1419
/**
1520
* The main function
1621
*
@@ -32,13 +37,24 @@ function main($argv)
3237
} else {
3338
define('ES_HOST', ES_DEFAULT_HOST);
3439
}
35-
40+
3641
$directory = new RecursiveDirectoryIterator($lang);
3742
$recurser = new RecursiveIteratorIterator($directory);
3843
$matcher = new RegexIterator($recurser, '/\.rst/');
3944

4045
foreach ($matcher as $file) {
41-
updateIndex($lang, $file);
46+
$skip = false;
47+
foreach (FILE_EXCLUSIONS as $exclusion) {
48+
if (preg_match($exclusion, $file) === 1) {
49+
echo "\nSkipping $file\n";
50+
$skip = true;
51+
break;
52+
}
53+
}
54+
55+
if (!$skip) {
56+
updateIndex($lang, $file);
57+
}
4258
}
4359

4460
echo "\nIndex update complete\n";

0 commit comments

Comments
 (0)