Skip to content

Instantly share code, notes, and snippets.

@parabuzzle
Last active September 28, 2016 19:46
Show Gist options
  • Save parabuzzle/e525dc564d7fc8bf83d189ae919ae56b to your computer and use it in GitHub Desktop.
Save parabuzzle/e525dc564d7fc8bf83d189ae919ae56b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Wraps a command in the warm and cozy shell we want
#
# Author:: Michael Heijmans (mailto:[email protected])
# Copyright:: Copyright (c) 2016 Michael Heijmans
# License:: MIT
set -e
echo -e "Establishing the environment for $APP_ENV from $VAULT_ADDR"
export APP_ENV_MAP=${APP_ENV_FILE:-/tmp/app_env}
# raise an error if there is no vault token
if [ -z $VAULT_TOKEN ]; then
echo "no VAULT_TOKEN set!"
exit 1
fi
source $APP_ENV_MAP
echo -e "Finished establishing the environment for $APP_ENV from $VAULT_ADDR"
$@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment