Skip to content

Instantly share code, notes, and snippets.

@sergiopena
Created December 20, 2019 10:34
Show Gist options
  • Save sergiopena/7906f743123498c76188e848948fa8ed to your computer and use it in GitHub Desktop.
Save sergiopena/7906f743123498c76188e848948fa8ed to your computer and use it in GitHub Desktop.
Manager script for spinnaker microservices in dev environment
#!/usr/bin/env bash
clouddriver_key=[redacted]
clouddriver_secret=[redacted]
front50_key=user
front50_secret=password
MICROSERVICES="clouddriver deck echo fiat front50 gate igor kayenta orca rosco"
function usage() {
echo "Tool to manage Spinnaker local development environment"
echo "usage: naker action [devel|microservice_name]"
echo " Edit the script to set devel collection of microservices, this is intended to bring up all env but the ones launched by your IDE"
echo " you can also use it to manage individual services e.g. `naker start orca`"
echo "\n"
echo " actions: start|stop"
echo "\n"
echo ""
}
if [ -z "$2" ]
then
MICROSERVICES="clouddriver deck echo fiat front50 gate igor kayenta orca rosco"
elif [ $2 == "devel" ]
then
MICROSERVICES="deck echo fiat front50 gate igor kayenta rosco"
else
MICROSERVICES=$2
fi
case $1 in
start )
echo "Starting service(s)... $MICROSERVICES"
;;
stop )
echo "Stopping service(s)...$MICROSERVICES"
;;
* )
usage
esac
for ms in $MICROSERVICES;
do
key=${ms}_key
secret=${ms}_secret
if [ ${!key} ] && [ ${!secret} ]
then
echo ">> $1ting $ms with custom credentials..."
AWS_ACCESS_KEY_ID=${!key} AWS_SECRET_ACCESS_KEY=${!secret} ./${ms}-${1}.sh
else
echo ">> $1ing $ms..."
./${ms}-${1}.sh
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment