Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Feat/allow custom region in scripts (#150)
Browse files Browse the repository at this point in the history
* feat: Allows us to specify a region to execute the cli in when using the provided scripts
  • Loading branch information
tunderwood authored Aug 21, 2020
1 parent 4ddd793 commit 3af992f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 8 additions & 2 deletions execute-cerberus-lifecycle-cli-command-signalfx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
set -e

echo "ENVIRONMENT=${ENVIRONMENT}"
echo "REGION=${REGION}"

if [ -z ${REGION} ]; then
REGION="us-west-2"
fi

IP_ADDRESS=$(curl -s http://checkip.amazonaws.com/)
echo ""
echo "-----------------------------------------------------------------------------------------------------------------"
echo ""
echo "Executing command: '${COMMAND} ${ADDITIONAL_COMMAND_OPTIONS}' in environment: '${ENVIRONMENT}' with the following external IP address: ${IP_ADDRESS}"
echo "Executing command: '${COMMAND} ${ADDITIONAL_COMMAND_OPTIONS}' in environment: '${ENVIRONMENT}' and region '${REGION}
with the following external IP address: ${IP_ADDRESS}"
echo ""
echo "-----------------------------------------------------------------------------------------------------------------"
echo ""

cerberus -e ${ENVIRONMENT} --no-tty ${COMMAND} ${ADDITIONAL_COMMAND_OPTIONS}
cerberus -e ${ENVIRONMENT} -r ${REGION} --no-tty ${COMMAND} ${ADDITIONAL_COMMAND_OPTIONS}

curl -s -X POST \
https://ingest.signalfx.com/v2/datapoint \
Expand Down
10 changes: 8 additions & 2 deletions execute-cerberus-lifecycle-cli-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
# execute-backup-command.sh

echo "ENVIRONMENT=${ENVIRONMENT}"
echo "REGION=${REGION}"

if [ -z ${REGION} ]; then
REGION="us-west-2"
fi

IP_ADDRESS=$(curl -s http://checkip.amazonaws.com/)
echo ""
echo "-----------------------------------------------------------------------------------------------------------------"
echo ""
echo "Executing command: '${COMMAND} ${ADDITIONAL_COMMAND_OPTIONS}' in environment: '${ENVIRONMENT}' with the following external IP address: ${IP_ADDRESS}"
echo "Executing command: '${COMMAND} ${ADDITIONAL_COMMAND_OPTIONS}' in environment: '${ENVIRONMENT}' and region '${REGION}
with the following external IP address: ${IP_ADDRESS}"
echo ""
echo "-----------------------------------------------------------------------------------------------------------------"
echo ""

cerberus -e ${ENVIRONMENT} --no-tty ${COMMAND} ${ADDITIONAL_COMMAND_OPTIONS}
cerberus -e ${ENVIRONMENT} -r ${REGION} --no-tty ${COMMAND} ${ADDITIONAL_COMMAND_OPTIONS}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

group=com.nike
artifactId=cerberus-lifecycle-cli
version=4.14.0
version=4.15.0

0 comments on commit 3af992f

Please sign in to comment.