Skip to content

Commit

Permalink
Merge pull request guardian#1791 from guardian/aa-janus-support
Browse files Browse the repository at this point in the history
adds Janus support for cf actions
  • Loading branch information
akash1810 committed Mar 3, 2016
2 parents f1d0da0 + 98a27d9 commit 47101e2
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions cloud-formation/scripts/stack-name.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
#!/bin/bash

if [ -z "$ENV" ];
if [ -z "$GRID_STACK_NAME" ];
then
export STACK_NAME="media-service-DEV-`aws iam get-user | jq '.User.UserName' | tr -d '"' | tr [A-Z] [a-z]`"
USER_NAME=`aws iam get-user`

if [ $? != "0" ]; then
echo -e "\033[1;41m FAILED! \033[m"
echo '`iam get-user` failed. Are you using temporary credentials?'
echo 'If you are using temporary credentials please set the GRID_STACK_NAME environment variable and try again:'
echo ''
echo " export GRID_STACK_NAME=DEV-foo && $0"
echo ''
exit 1
else
export STACK_NAME="media-service-DEV-`$USER_NAME | jq '.User.UserName' | tr -d '"' | tr [A-Z] [a-z]`"
fi
else
export STACK_NAME="media-service-$ENV"
export STACK_NAME="media-service-$GRID_STACK_NAME"
fi

0 comments on commit 47101e2

Please sign in to comment.