This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
45 lines (31 loc) · 1.46 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Makefile for Docker Nginx PHP Composer
build-db:
@docker exec postgres sh -c "psql -c 'create database testing with owner talentcloud;' -U talentcloud"
@docker exec talentcloud sh -c "php artisan migrate && php artisan db:seed"
clean:
@rm -Rf composer.lock package-lock.json etc/ssl/ node_modules/ report/ vendor/
composer-install:
@docker run --rm -v $(shell pwd):/app composer install
docker-start:
@docker-compose up -d
docker-stop:
@docker-compose down
fake-data:
@docker exec talentcloud sh -c "php artisan db:seed"
fresh-db:
@docker exec talentcloud sh -c "php artisan migrate:fresh"
gen-certs:
@docker run --rm -v $(shell pwd)/etc/ssl:/certificates -e "SERVER=localhost" jacoelho/generate-certificate
logs:
@docker-compose logs -f
phpunit:
# uses phpdbg to generate code coverage (instead of xdebug)
@docker exec talentcloud sh -c "phpdbg -qrr ./vendor/bin/phpunit -dmemory_limit=4G --coverage-clover=report/phpunit/coverage.xml --log-junit=report/phpunit/junit.phpunit.xml"
set-perms:
@docker exec talentcloud sh -c "chown -R www-data /var/www/storage /var/www/vendor /var/www/bootstrap/cache"
@docker exec talentcloud sh -c "chmod -R 775 /var/www"
create-symlink:
@docker exec talentcloud sh -c "php artisan storage:link"
test:
@docker exec talentcloud sh -c "phpdbg -qrr ./vendor/bin/phpunit -dmemory_limit=4G --no-coverage"
.PHONY: build-db clean composer-install docker-start docker-stop fake-data fresh-db gen-certs logs phpunit set-perms test