#!/bin/bash

set -euo pipefail

source "${BASH_SOURCE%/*}/lib.sh"

function usage() {
  echo "Usage: $0 <`getAvailableEnvironments | tr '\n' '|' | sed 's/|$//'`> <presto cli args>"
  exit 1
 }

if [[ $# == 0 ]]; then
  usage
fi

ENVIRONMENT=$1
shift 1

# Get the list of valid environments
if [[ ! -f "$DOCKER_CONF_LOCATION/$ENVIRONMENT/compose.sh" ]]; then
  usage
fi

environment_compose run -p 5007:5007 application-runner /docker/volumes/conf/docker/files/presto-cli.sh "$@"

#!/bin/bash

set -euo pipefail

source "${BASH_SOURCE%/*}/lib.sh"

function usage() {
  echo "Usage: $0 <`getAvailableEnvironments | tr '\n' '|' | sed 's/|$//'`> <presto cli args>"
  exit 1
 }

if [[ $# == 0 ]]; then
  usage
fi

ENVIRONMENT=$1
shift 1

# Get the list of valid environments
if [[ ! -f "$DOCKER_CONF_LOCATION/$ENVIRONMENT/compose.sh" ]]; then
  usage
fi

environment_compose run -p 5008:5008 application-runner /docker/volumes/conf/docker/files/presto-cli.sh "$@"

Use non-conflicting port for debugging
Use non-conflicting port for debugging

5007 is used for product tests (tempto) debugging, use 5008 for CLI.
