Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: skip build for APM Server if there are no code changes #3051

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .buildkite/scripts/build_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,23 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then

cd ./product-repo &&
git fetch origin pull/$GITHUB_PR_NUMBER/head:pr_$GITHUB_PR_NUMBER &&
git switch pr_$GITHUB_PR_NUMBER &&
cd ..
git switch pr_$GITHUB_PR_NUMBER

if [[ "${GITHUB_PR_BASE_REPO}" == 'apm-server' ]]; then
docs_diff=$(git diff --stat "$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs ./changelogs CHANGELOG.asciidoc)
else
docs_diff=$(git diff --stat "$GITHUB_PR_TARGET_BRANCH"...HEAD)
fi

if [[ -z $docs_diff ]]; then
echo "${GITHUB_PR_TARGET_BRANCH} in ${GITHUB_PR_BASE_REPO} has no docs changes"
exit 0
fi

echo "diff:"
echo "$docs_diff"

cd ..
# For product repos - context in https://github.com/elastic/docs/commit/5b06c2dc1f50208fcf6025eaed6d5c4e81200330
build_args+=" --keep_hash"
build_args+=" --sub_dir $GITHUB_PR_BASE_REPO:$GITHUB_PR_TARGET_BRANCH:./product-repo"
Expand Down