Skip to content

Commit

Permalink
Merge pull request #21 from graze/docker
Browse files Browse the repository at this point in the history
Docker!
  • Loading branch information
sjparkinson committed Oct 19, 2015
2 parents cd4802b + edb0579 commit 3760463
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 27 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM php:5.6-cli

RUN pecl install xdebug && \
echo "zend_extension=xdebug.so" >> "/usr/local/etc/php/conf.d/xdebug.ini"

RUN ["docker-php-ext-install", "mbstring"]

ADD . /opt/graze/queue

WORKDIR /opt/graze/queue
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
SHELL = /bin/sh

.PHONY: install composer clean help
.PHONY: test test-unit test-intergration test-coverage test-matrix

.SILENT: help

install: ## Download the depenedencies then build the image :rocket:.
make 'composer-install --optimize-autoloader --ignore-platform-reqs'
docker build --tag graze-queue:latest .

composer-%: ## Run a composer command, `make "composer-<command> [...]"`.
docker run -it --rm \
-v $$(pwd):/app \
-v ~/.composer:/root/composer \
-v ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro \
-v ~/.ssh/known_hosts:/root/.ssh/known_hosts:ro \
composer/composer:master --no-interaction $*


test: ## Run the unit and intergration testsuites.
test: test-unit test-intergration

test-unit: ## Run the unit testsuite.
docker run --rm -t graze-queue \
vendor/bin/phpunit --testsuite unit

test-intergration: ## Run the integration testsuite.
docker run --rm -t graze-queue \
vendor/bin/phpunit --testsuite integration

test-coverage: ## Run the testsuites with coverage enabled.
docker run --rm -t graze-queue \
vendor/bin/phpunit --coverage-text --testsuite unit
docker run --rm -t graze-queue \
vendor/bin/phpunit --coverage-text --testsuite integration

test-matrix:
docker run --rm -t -v $$(pwd):/opt/graze/queue -w /opt/graze/queue php:5.5-cli \
vendor/bin/phpunit --testsuite unit
docker run --rm -t -v $$(pwd):/opt/graze/queue -w /opt/graze/queue php:5.6-cli \
vendor/bin/phpunit --testsuite unit
docker run --rm -t -v $$(pwd):/opt/graze/queue -w /opt/graze/queue php:7.0-cli \
vendor/bin/phpunit --testsuite unit


clean: ## Stop running containers and clean up an images.
docker rmi graze-queue:latest

help: ## Show this help message.
echo "usage: make [target] ..."
echo ""
echo "targets:"
fgrep --no-filename "##" $(MAKEFILE_LIST) | fgrep --invert-match $$'\t' | sed -e 's/## //'
27 changes: 0 additions & 27 deletions Vagrantfile

This file was deleted.

0 comments on commit 3760463

Please sign in to comment.