Skip to content

Commit

Permalink
Add Windows compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed Nov 26, 2024
1 parent 7e4637d commit 344ca77
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ if [[ -f /etc/os-release ]] && grep -q '"Amazon Linux 2"' /etc/os-release; then
sudo systemctl restart dnsmasq.service
fi

if [[ "${BUILDKITE_PULL_REQUEST:-}" && "${BUILDKITE_LABEL:-}" != *"Pipeline upload"* && "${BUILDKITE_LABEL:-}" != *"Upload Pipeline"* ]]; then
source .buildkite/scripts/get-latest-test-mutes.sh
if [[ "${BUILDKITE_PULL_REQUEST:-}" && "${BUILDKITE_AGENT_META_DATA_PROVIDER:-}" != "k8s" ]]; then
.buildkite/scripts/get-latest-test-mutes.sh
fi
3 changes: 3 additions & 0 deletions .buildkite/hooks/pre-command.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ set BUILD_NUMBER=%BUILDKITE_BUILD_NUMBER%
set COMPOSE_HTTP_TIMEOUT=120
set JOB_BRANCH=%BUILDKITE_BRANCH%

set GH_TOKEN=%VAULT_GITHUB_TOKEN%

set GRADLE_BUILD_CACHE_USERNAME=vault read -field=username secret/ci/elastic-elasticsearch/migrated/gradle-build-cache
set GRADLE_BUILD_CACHE_PASSWORD=vault read -field=password secret/ci/elastic-elasticsearch/migrated/gradle-build-cache

bash.exe -c "nohup bash .buildkite/scripts/setup-monitoring.sh </dev/null >/dev/null 2>&1 &"
bash.exe -c "bash .buildkite/scripts/get-latest-test-mutes.sh"

exit /b 0
10 changes: 8 additions & 2 deletions .buildkite/scripts/get-latest-test-mutes.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

if [[ ! "${BUILDKITE_PULL_REQUEST:-}" || "${BUILDKITE_AGENT_META_DATA_PROVIDER:-}" == "k8s" ]]; then
exit 0
fi

testMuteBranch="${BUILDKITE_PULL_REQUEST_BASE_BRANCH:-main}"
testMuteFile="$(mktemp)"

Expand All @@ -12,7 +16,9 @@ testMuteFile="$(mktemp)"
cat "$testMuteFile"

if [[ -s "$testMuteFile" ]]; then
export GRADLE_OPTS="${GRADLE_OPTS:-} -Dorg.gradle.project.org.elasticsearch.additional.muted.tests=$testMuteFile"
echo "GRADLE_OPTS='$GRADLE_OPTS'"
mkdir -p ~/.gradle
# This is using gradle.properties instead of an env var so that it's easily compatible with the Windows pre-command hook
echo "org.gradle.project.org.elasticsearch.additional.muted.tests=$testMuteFile" >> ~/.gradle/gradle.properties
cat ~/.gradle/gradle.properties
fi
# fi

0 comments on commit 344ca77

Please sign in to comment.