Skip to content

Commit

Permalink
Port the script to obtain the OpenSearch version
Browse files Browse the repository at this point in the history
Solves upwards compatibility as the original script is removed in 2.6.0.
  • Loading branch information
AlexRuiz7 committed Apr 17, 2023
1 parent 24a4a06 commit ef94275
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ fi

# Common variables
export REPO_PATH=$(pwd)
export NODE_VERSION=$(cat .nvmrc)
export OPENSEARCH_VERSION=$(bash dev-tools/get-version.sh)
export NODE_VERSION=$(cat $REPO_PATH/.nvmrc)
export OPENSEARCH_VERSION=$(bash $REPO_PATH/docker/get_version.sh)

COMPOSE_CMD="docker compose -f $COMPOSE_FILE"

Expand Down
15 changes: 15 additions & 0 deletions docker/get_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0

set -e

PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d [:space:])

echo "$PACKAGE_VERSION"

0 comments on commit ef94275

Please sign in to comment.