Skip to content

Commit 7d3e313

Browse files
authored
Merge pull request #63 from donoghuc/update-ls-release
Track logstash versions in .ci
2 parents 20be9fd + 2298968 commit 7d3e313

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

.ci/docker-setup.sh

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ pull_docker_snapshot() {
3131
: "${TEST_MODE:=$([[ "${INTEGRATION}" = "true" ]] && echo "integration" || echo "unit")}"
3232
export TEST_MODE
3333

34-
VERSION_URL="https://raw.githubusercontent.com/elastic/logstash/main/ci/logstash_releases.json"
35-
3634
if [ -z "${ELASTIC_STACK_VERSION}" ]; then
3735
echo "Please set the ELASTIC_STACK_VERSION environment variable"
3836
echo "For example: export ELASTIC_STACK_VERSION=7.x"
@@ -42,26 +40,22 @@ fi
4240
# The ELASTIC_STACK_VERSION may be an alias, save the original before translating it
4341
ELASTIC_STACK_VERSION_ALIAS="$ELASTIC_STACK_VERSION"
4442

45-
echo "Fetching versions from $VERSION_URL"
46-
VERSIONS=$(curl -s $VERSION_URL)
47-
43+
echo "Computing latest stream version"
44+
VERSION_CONFIG_FILE="$(dirname "$0")/logstash-versions.yml"
4845
if [[ "$SNAPSHOT" = "true" ]]; then
49-
ELASTIC_STACK_RETRIEVED_VERSION=$(echo $VERSIONS | jq '.snapshots."'"$ELASTIC_STACK_VERSION"'"')
50-
echo $ELASTIC_STACK_RETRIEVED_VERSION
46+
ELASTIC_STACK_RETRIEVED_VERSION=$(ruby -r yaml -e "puts YAML.load_file('$VERSION_CONFIG_FILE')['snapshots']['$ELASTIC_STACK_VERSION']")
5147
else
52-
ELASTIC_STACK_RETRIEVED_VERSION=$(echo $VERSIONS | jq '.releases."'"$ELASTIC_STACK_VERSION"'"')
48+
ELASTIC_STACK_RETRIEVED_VERSION=$(ruby -r yaml -e "puts YAML.load_file('$VERSION_CONFIG_FILE')['releases']['$ELASTIC_STACK_VERSION']")
5349
fi
5450

55-
if [[ "$ELASTIC_STACK_RETRIEVED_VERSION" != "null" ]]; then
56-
# remove starting and trailing double quotes
57-
ELASTIC_STACK_RETRIEVED_VERSION="${ELASTIC_STACK_RETRIEVED_VERSION%\"}"
58-
ELASTIC_STACK_RETRIEVED_VERSION="${ELASTIC_STACK_RETRIEVED_VERSION#\"}"
59-
echo "Translated $ELASTIC_STACK_VERSION to ${ELASTIC_STACK_RETRIEVED_VERSION}"
51+
if [[ -n "$ELASTIC_STACK_RETRIEVED_VERSION" ]]; then
52+
echo "Translating ELASTIC_STACK_VERSION to ${ELASTIC_STACK_RETRIEVED_VERSION}"
6053
export ELASTIC_STACK_VERSION=$ELASTIC_STACK_RETRIEVED_VERSION
61-
elif [[ "$ELASTIC_STACK_VERSION" == "8.next" ]]; then
62-
# we know "8.next" only exists between FF and GA of a minor
63-
# exit 1 so the build is skipped
64-
exit 1
54+
elif [[ "$ELASTIC_STACK_VERSION" == "9.next" ]]; then
55+
exit 99
56+
else
57+
# No version translation found, assuming user provided explicit version
58+
echo "No version found for $ELASTIC_STACK_VERSION, using as-is"
6559
fi
6660

6761
case "${DISTRIBUTION}" in

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ jobs:
1010
env: INTEGRATION=true ELASTIC_STACK_VERSION=7.current
1111
- env: INTEGRATION=true ELASTIC_STACK_VERSION=8.previous
1212
- env: INTEGRATION=true ELASTIC_STACK_VERSION=8.current
13+
- env: INTEGRATION=true ELASTIC_STACK_VERSION=9.current
14+
- env: INTEGRATION=true ELASTIC_STACK_VERSION=9.previous
1315
- env: INTEGRATION=true SNAPSHOT=true ELASTIC_STACK_VERSION=7.current
1416
- env: INTEGRATION=true SNAPSHOT=true ELASTIC_STACK_VERSION=8.previous
1517
- env: INTEGRATION=true SNAPSHOT=true ELASTIC_STACK_VERSION=8.current
16-
- env: INTEGRATION=true SNAPSHOT=true ELASTIC_STACK_VERSION=8.next
17-
- env: INTEGRATION=true SNAPSHOT=true ELASTIC_STACK_VERSION=8.future
18+
- env: INTEGRATION=true SNAPSHOT=true ELASTIC_STACK_VERSION=9.previous
19+
- env: INTEGRATION=true SNAPSHOT=true ELASTIC_STACK_VERSION=9.current
1820
- env: INTEGRATION=true SNAPSHOT=true ELASTIC_STACK_VERSION=main

0 commit comments

Comments
 (0)