Skip to content

Commit 7b4e73d

Browse files
committed
Update variable name to be more descriptive
This commit updates the script to be more descriptive with the naming of a variable that indicates the stack version. The stack version may be an alias when provided to this script. Using variable names to track when we are dealing with a potential alias (vs when we have normalized) helps with maintainability.
1 parent c279f8f commit 7b4e73d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docker-setup.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ set -e
66

77
pull_docker_snapshot() {
88
project="${1?project name required}"
9-
stack_version="${2?stack version required}"
9+
stack_version_alias="${2?stack version alias required}"
1010
local docker_image="docker.elastic.co/${project}/${project}${DISTRIBUTION_SUFFIX}:${ELASTIC_STACK_VERSION}"
1111
echo "Pulling $docker_image"
1212
if docker pull "$docker_image" ; then
1313
echo "docker pull successful"
1414
else
15-
case $stack_version in
15+
case $stack_version_alias in
1616
"8.previous"|"8.current"|"8.next")
1717
exit 1
1818
;;
@@ -31,8 +31,8 @@ if [ -z "${ELASTIC_STACK_VERSION}" ]; then
3131
exit 1
3232
fi
3333

34-
# save the original unmodified string to pass to pull_docker_snapshot
35-
ELASTIC_STACK_VERSION_ARG="$ELASTIC_STACK_VERSION"
34+
# The ELASTIC_STACK_VERSION may be an alias, save the original before translating it
35+
ELASTIC_STACK_VERSION_ALIAS="$ELASTIC_STACK_VERSION"
3636

3737
echo "Fetching versions from $VERSION_URL"
3838
VERSIONS=$(curl -s $VERSION_URL)
@@ -64,7 +64,7 @@ export DISTRIBUTION_SUFFIX
6464
echo "Testing against version: $ELASTIC_STACK_VERSION (distribution: ${DISTRIBUTION:-"default"})"
6565

6666
if [[ "$ELASTIC_STACK_VERSION" = *"-SNAPSHOT" ]]; then
67-
pull_docker_snapshot "logstash" $ELASTIC_STACK_VERSION_ARG
67+
pull_docker_snapshot "logstash" $ELASTIC_STACK_VERSION_ALIAS
6868
fi
6969

7070
if [ -f Gemfile.lock ]; then

0 commit comments

Comments
 (0)