Skip to content

Commit 3760463

Browse files
committed
Merge pull request #21 from graze/docker
Docker!
2 parents cd4802b + edb0579 commit 3760463

File tree

3 files changed

+64
-27
lines changed

3 files changed

+64
-27
lines changed

Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM php:5.6-cli
2+
3+
RUN pecl install xdebug && \
4+
echo "zend_extension=xdebug.so" >> "/usr/local/etc/php/conf.d/xdebug.ini"
5+
6+
RUN ["docker-php-ext-install", "mbstring"]
7+
8+
ADD . /opt/graze/queue
9+
10+
WORKDIR /opt/graze/queue

Makefile

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
SHELL = /bin/sh
2+
3+
.PHONY: install composer clean help
4+
.PHONY: test test-unit test-intergration test-coverage test-matrix
5+
6+
.SILENT: help
7+
8+
install: ## Download the depenedencies then build the image :rocket:.
9+
make 'composer-install --optimize-autoloader --ignore-platform-reqs'
10+
docker build --tag graze-queue:latest .
11+
12+
composer-%: ## Run a composer command, `make "composer-<command> [...]"`.
13+
docker run -it --rm \
14+
-v $$(pwd):/app \
15+
-v ~/.composer:/root/composer \
16+
-v ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro \
17+
-v ~/.ssh/known_hosts:/root/.ssh/known_hosts:ro \
18+
composer/composer:master --no-interaction $*
19+
20+
21+
test: ## Run the unit and intergration testsuites.
22+
test: test-unit test-intergration
23+
24+
test-unit: ## Run the unit testsuite.
25+
docker run --rm -t graze-queue \
26+
vendor/bin/phpunit --testsuite unit
27+
28+
test-intergration: ## Run the integration testsuite.
29+
docker run --rm -t graze-queue \
30+
vendor/bin/phpunit --testsuite integration
31+
32+
test-coverage: ## Run the testsuites with coverage enabled.
33+
docker run --rm -t graze-queue \
34+
vendor/bin/phpunit --coverage-text --testsuite unit
35+
docker run --rm -t graze-queue \
36+
vendor/bin/phpunit --coverage-text --testsuite integration
37+
38+
test-matrix:
39+
docker run --rm -t -v $$(pwd):/opt/graze/queue -w /opt/graze/queue php:5.5-cli \
40+
vendor/bin/phpunit --testsuite unit
41+
docker run --rm -t -v $$(pwd):/opt/graze/queue -w /opt/graze/queue php:5.6-cli \
42+
vendor/bin/phpunit --testsuite unit
43+
docker run --rm -t -v $$(pwd):/opt/graze/queue -w /opt/graze/queue php:7.0-cli \
44+
vendor/bin/phpunit --testsuite unit
45+
46+
47+
clean: ## Stop running containers and clean up an images.
48+
docker rmi graze-queue:latest
49+
50+
help: ## Show this help message.
51+
echo "usage: make [target] ..."
52+
echo ""
53+
echo "targets:"
54+
fgrep --no-filename "##" $(MAKEFILE_LIST) | fgrep --invert-match $$'\t' | sed -e 's/## //'

Vagrantfile

-27
This file was deleted.

0 commit comments

Comments
 (0)