Last active
October 21, 2015 05:17
-
-
Save xav-b/ff9f6e007adc607c9efa to your computer and use it in GitHub Desktop.
Awesome autenv config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# abort quietly if already setup | |
[ -z "${__PROJECT__}" ] || return | |
# generic project management | |
export __PROJECT__="$(basename $PWD)" | |
# go specific settings | |
export __GO_VERSION__="1.5.1" | |
export GO_VENDOR=1 | |
export GO15VENDOREXPERIMENT=1 | |
# private credentials, services configuration | |
export PUSHBULLET_API_KEY="v1chKeAT4fSF4oQHbgvkn7U8EuPpKfIIh7ujzfwn9yG6e" | |
pretty_log() { | |
autoenv_printf "$@" | |
} | |
# TODO use buildpacks to detect language | |
activate_virtual_runtime() { | |
gvm use go${__GO_VERSION__} | |
} | |
# TODO check requirements | |
start_env() { | |
local MACHINE_NAME="${1:-dev}" | |
docker-machine start ${MACHINE_NAME} && eval "$(docker-machine env ${MACHINE_NAME})" | |
docker-compose up -d | |
docker-compose ps | |
} | |
start_timer() { | |
local project=$1 | |
timetrap sheet ${project} | |
pretty_log "add notes: " | |
read notes | |
timetrap in ${notes} | |
timetrap display | |
pretty_log "run timetrap out once done\n" | |
} | |
pretty_log "spinning up containers" | |
start_env "dev" | |
pretty_log "loading virtualenv" | |
activate_virtual_runtime | |
pretty_log "starting time tracker" | |
start_timer "${__PROJECT__}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# TODO wip ... | |
unset __PROJECT__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment