Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function aws-vault() {
- local aws_vault_cmd=$(which aws-vault)
- if [ -z "${aws_vault_cmd}" ]; then
- echo "aws-vault is not on your path you do not have it installed"
- exit 1
- fi
- case "$1" in
- exec)
- local action=$1
- shift 1
- local profile=$1
- shift 1
- local options="--assume-role-ttl=1h --session-ttl=4h"
- #${aws_vault_cmd} ${action} ${profile} ${options} -- $@
- ${aws_vault_cmd} ${action} ${profile} ${options} $@
- ;;
- *)
- ${aws_vault_cmd} $@
- ;;
- esac
- }
- # Nubis docker specific function
- function nubis-build() {
- if [ -z "${1}" ]; then echo "Usage: $FUNCNAME <docker image name>"; exit 1; fi
- local docker_image=$1
- shift 1
- local args=$@
- echo "Running on profile: $(cat ~/.docker.env | grep AWS_VAULT | cut -f2 -d "=")"
- docker_cmd="docker run -u "${UID}:$(id -g)" --interactive --tty --env-file $(echo ~)/.docker.env -v "$PWD:/nubis/data" -e "GIT_COMMIT_SHA=$(git rev-parse HEAD)""
- ${docker_cmd} ${docker_image} ${args} build
- # FIXME: won't be able to do other things like debug
- #if [ ! -z "${args}" ]; then
- # ${docker_cmd} ${docker_image} ${args} build
- #else
- # ${docker_cmd} ${docker_image}
- #fi
- }
- # untested :)
- function nubis-deploy() {
- if [ -z "${1}" ]; then echo "Usage: $FUNCNAME <docker image name>"; exit 1; fi
- local docker_image=$1
- shift 1
- local args=$@
- echo "Running on profile: $(cat ~/.docker.env | grep AWS_VAULT | cut -f2 -d "=")"
- docker run --interactive --tty --env-file $(echo ~)/.docker.env -v $PWD:/nubis/data ${docker_image} ${args}
- }
Add Comment
Please, Sign In to add comment