Skip to content

Instantly share code, notes, and snippets.

@oivoodoo
Created April 1, 2017 20:23
Show Gist options
  • Save oivoodoo/f1869d0c7803bd26d979ca0b3dc66f15 to your computer and use it in GitHub Desktop.
Save oivoodoo/f1869d0c7803bd26d979ca0b3dc66f15 to your computer and use it in GitHub Desktop.
NAME=hive-queries
DOCKER_IDS = $(shell docker ps -a -q --filter status=running --filter ancestor=$(NAME) --format="{{.ID}}")
build:
if ! ls $(HOME)/.rbenv/versions | grep `cat .ruby-version` ; then rbenv install `cat .ruby-version` || true ; fi
gem install bundler --no-ri --no-rdoc
bundle install
docker build -t $(NAME) .
.PHONY: build
clean:
docker rmi --force $(NAME) || true
.PHONY: clean
test:
docker kill $(DOCKER_IDS) || true
DOCKER_IMAGE_NAME=$(NAME) bundle exec rspec $(TEST_CASE)
.PHONY: test
attach:
docker exec -it $(DOCKER_IDS) /bin/bash
.PHONY: attach
console:
docker run -v `pwd`/../:/app -it $(NAME) /bin/bash
.PHONY: console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment