Skip to content

Commit 05da2ba

Browse files
kruskallbmorelli25
andauthored
feat(all): only build docs if there's a doc change (#3067)
* feat(all): only build docs if there's a doc change extend the check to all remaining repositories * Update build_pr.sh --------- Co-authored-by: Brandon Morelli <[email protected]>
1 parent ad6c9e3 commit 05da2ba

File tree

1 file changed

+96
-1
lines changed

1 file changed

+96
-1
lines changed

.buildkite/scripts/build_pr.sh

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then
6666
;;
6767

6868
# repositories with a docs dir
69-
"apm-k8s-attacher")
69+
"apm-k8s-attacher" | "cloud" | "cloud-assets" | "cloud-on-k8s" | "ecctl" | "ecs" | "ecs-dotnet" | "ecs-logging" | "ecs-logging-go-logrus" | "ecs-logging-go-zap" | "ecs-logging-go-zerolog" | "ecs-logging-java" | "ecs-logging-nodejs" | "ecs-logging-php" | "ecs-logging-python" | "ecs-logging-ruby" | "elasticsearch-js" | "elasticsearch-js-legacy" | "elasticsearch-ruby" | "elasticsearch-php" | "elasticsearch-perl" | "elasticsearch-rs" | "kibana-cn" | "logstash" | "logstash-docs" | "security-docs" | "sense" | "swiftype")
7070
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
7171
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs)
7272
;;
@@ -77,6 +77,101 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then
7777
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs ./changelogs CHANGELOG.asciidoc)
7878
;;
7979

80+
"beats")
81+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
82+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./auditbeat ./CHANGELOG.asciidoc ./docs ./filebeat ./heartbeat ./journalbeat ./libbeat/docs ./libbeat/outputs/*/docs/* ./libbeat/processors/*/docs/* ./metricbeat ./packetbeat ./topbeat/docs ./winlogbeat ./x-pack/auditbeat ./x-pack/dockerlogbeat/docs ./x-pack/filebeat/docs ./x-pack/filebeat/processors/*/docs/* ./x-pack/functionbeat ./x-pack/libbeat/docs ./x-pack/libbeat/processors/*/docs/* ./x-pack/metricbeat/module)
83+
;;
84+
85+
"clients-team")
86+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
87+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/examples/elastic-cloud)
88+
;;
89+
90+
"curator")
91+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
92+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/asciidoc)
93+
;;
94+
95+
"eland" | "enterprise-search-php" | "enterprise-search-python" | "enterprise-search-ruby")
96+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
97+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/guide)
98+
;;
99+
100+
"elasticsearch")
101+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
102+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client ./docs ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql)
103+
;;
104+
105+
"elasticsearch-hadoop")
106+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
107+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/src/reference/asciidoc)
108+
;;
109+
110+
"elasticsearch-java")
111+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
112+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs ./java-client/src/test/java/co/elastic/clients/documentation)
113+
;;
114+
115+
"elasticsearch-net")
116+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
117+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs ./tests/Tests/Documentation)
118+
;;
119+
120+
"elasticsearch-py")
121+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
122+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/guide ./docs/examples)
123+
;;
124+
125+
"go-elasticsearch")
126+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
127+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./.doc)
128+
;;
129+
130+
"enterprise-search-pubs")
131+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
132+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./enterprise-search-docs ./workplace-search-docs ./app-search-docs ./esre-docs ./client-docs/app-search-javascript ./client-docs/app-search-node ./client-docs/workplace-search-node)
133+
;;
134+
135+
"enterprise-search-js")
136+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
137+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./packages/enterprise-search/docs)
138+
;;
139+
140+
"esf" | "ingest-docs" | "observability-docs" | "stack-docs" | "x-pack-logstash")
141+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
142+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/en)
143+
;;
144+
145+
"packagespec")
146+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
147+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./versions ./spec)
148+
;;
149+
150+
"tech-content")
151+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
152+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./welcome-to-elastic)
153+
;;
154+
155+
"terraform-provider-ec")
156+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
157+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs-elastic)
158+
;;
159+
160+
"x-pack")
161+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
162+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/public/graph ./docs/public/marvel ./docs/public/reporting ./docs/public/shield ./docs/public/watcher ./docs/en ./docs/kr ./docs/jp)
163+
;;
164+
165+
"x-pack-elasticsearch")
166+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
167+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/en ./docs/kr ./docs/jp ./qa/sql)
168+
;;
169+
170+
"x-pack-kibana")
171+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
172+
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/en ./docs/kr ./docs/jp)
173+
;;
174+
80175
# All other repos will always build
81176
*)
82177
docs_diff="always build"

0 commit comments

Comments
 (0)