Skip to content

Instantly share code, notes, and snippets.

@xav-b
Last active October 21, 2015 05:17
Show Gist options
  • Save xav-b/ff9f6e007adc607c9efa to your computer and use it in GitHub Desktop.
Save xav-b/ff9f6e007adc607c9efa to your computer and use it in GitHub Desktop.
Awesome autenv config
#!/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__}"
#!/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