mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
Use ES_VERSION to resolve manifest for ML and Beats (#130084)
Previously BRANCH was used in all cases, but if there is a newer version of the dependency, the incorrect version could be used. BRANCH is still used for snapshot DRA builds because full version is not available in artifacts-snapshot API. Additionally, added log what URL is used to fetch manifest and make the curl command fail in case of error like 404 response.
This commit is contained in:
parent
65788cb6fe
commit
c05794510d
1 changed files with 11 additions and 2 deletions
|
@ -6,7 +6,8 @@ strip_version() {
|
|||
}
|
||||
|
||||
fetch_build() {
|
||||
curl -sS https://artifacts-$1.elastic.co/$2/latest/$3.json \
|
||||
>&2 echo "Checking for build id: https://artifacts-$1.elastic.co/$2/latest/$3.json"
|
||||
curl -sSf https://artifacts-$1.elastic.co/$2/latest/$3.json \
|
||||
| jq -r '.build_id'
|
||||
}
|
||||
|
||||
|
@ -15,7 +16,15 @@ BRANCH="${BRANCH:-$2}"
|
|||
ES_VERSION="${ES_VERSION:-$3}"
|
||||
WORKFLOW=${WORKFLOW:-$4}
|
||||
|
||||
if [[ "$WORKFLOW" == "staging" ]]; then
|
||||
LATEST_BUILD=$(fetch_build $WORKFLOW $ARTIFACT $ES_VERSION)
|
||||
elif [[ "$WORKFLOW" == "snapshot" ]]; then
|
||||
LATEST_BUILD=$(fetch_build $WORKFLOW $ARTIFACT $BRANCH)
|
||||
else
|
||||
echo "Unknown workflow: $WORKFLOW"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LATEST_VERSION=$(strip_version $LATEST_BUILD)
|
||||
|
||||
# If the latest artifact version doesn't match what we expect, try the corresponding version branch.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue