Skip to content

Instantly share code, notes, and snippets.

@georgefs
Created January 25, 2015 15:59
Show Gist options
  • Save georgefs/71408ec0eaae262d2398 to your computer and use it in GitHub Desktop.
Save georgefs/71408ec0eaae262d2398 to your computer and use it in GitHub Desktop.
#! /bin/bash
#
# docker.sh
# Copyright (C) 2015 george.li <vagrant@vagrant-ubuntu-trusty-64>
#
# Distributed under terms of the MIT license.
#
img="tagtoo/quick-env"
curr=`pwd`
docker_run="sudo docker run -i --rm -v $curr:/srv/work -w /srv/work -t $img "
case $1 in
"test" )
$docker_run nosetests .
;;
"build" )
docker pull $img
docker_run npm install
docker_run pip install -r requirements.txt
;;
"run" )
cmd=`echo $@|sed "s/^\s*run//"`
$docker_run $cmd
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment