Skip to content

Commit 2c58ca6

Browse files
committed
Move gradlew retry loop
1 parent 48d96c6 commit 2c58ca6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.ci/scripts/packaging-test.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,14 @@ sudo mkdir -p /elasticsearch/qa/ && sudo chown jenkins /elasticsearch/qa/ && ln
6969
# See: https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory
7070
git config --global --add safe.directory $WORKSPACE
7171

72-
for attempt in 1 2 3 4 5; do ./gradlew --version && break; echo "Failed to download gradle wrapper - attempt $attempt/5" && sleep 5; done
73-
7472
# sudo sets it's own PATH thus we use env to override that and call sudo annother time so we keep the secure root PATH
7573
# run with --continue to run both bats and java tests even if one fails
7674
# be explicit about Gradle home dir so we use the same even with sudo
7775
sudo -E env \
7876
PATH=$BUILD_JAVA_HOME/bin:`sudo bash -c 'echo -n $PATH'` \
7977
--unset=ES_JAVA_HOME \
8078
--unset=JAVA_HOME \
81-
SYSTEM_JAVA_HOME=`readlink -f -n $BUILD_JAVA_HOME` \
82-
./gradlew -g $HOME/.gradle --scan --parallel --build-cache -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ --continue $@
79+
SYSTEM_JAVA_HOME=`readlink -f -n $BUILD_JAVA_HOME`; \
80+
for attempt in 1 2 3 4 5; do ./gradlew -g "$HOME/.gradle" --version && break; echo "Failed to download gradle wrapper - attempt $attempt/5" && sleep 5; done; \
81+
./gradlew -g "$HOME/.gradle" --scan --parallel --build-cache -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ --continue $@
8382

0 commit comments

Comments
 (0)