This repository has been archived by the owner on Mar 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
126 lines (102 loc) · 3.43 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
NAME := drupalwxt/site-fgp
VERSION := $(or $(VERSION),$(VERSION),'latest')
PLATFORM := $(shell uname -s)
all: base
build: all
behat:
./docker/bin/behat -c behat.yml --colors
clean:
rm -rf {html,vendor}
rm -f composer.lock
composer clear-cache
clean_docker:
docker rm $$(docker ps --all -q -f status=exited)
drupal_cs:
cp docker/conf/phpcs.xml html/core/phpcs.xml
cp docker/conf/phpunit.xml html/core/phpunit.xml
base:
docker build -f docker/Dockerfile \
-t $(NAME):$(VERSION) \
--no-cache \
--build-arg http_proxy=$$HTTP_PROXY \
--build-arg HTTP_PROXY=$$HTTP_PROXY \
--build-arg https_proxy=$$HTTP_PROXY \
--build-arg HTTPS_PROXY=$$HTTP_PROXY .
drupal_install:
docker exec sitefgp_cli bash /var/www/docker/bin/cli drupal-first-run fgp
drupal_migrate:
docker exec sitefgp_cli bash /var/www/docker/bin/cli drupal-migrate fgp
drush_archive:
./docker/bin/drush archive-dump --destination="/var/www/files_private/drupal$$(date +%Y%m%d_%H%M%S).tgz" \
--generator="Drupal"
env:
eval $$(docker-machine env default)
lint:
./docker/bin/lint
# http://stackoverflow.com/questions/4219255/how-do-you-get-the-list-of-targets-in-a-makefile
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
phpcs: drupal_cs
./docker/bin/phpcs --config-set installed_paths /var/www/vendor/drupal/coder/coder_sniffer
./docker/bin/phpcs --standard=/var/www/html/core/phpcs.xml \
--extensions=php,module,inc,install,test,profile,theme \
--report=full \
--colors \
--ignore=/var/www/html/profiles/wxt/modules/custom/wxt_test \
--ignore=/var/www/html/modules/custom/wxt_library \
--ignore=*.css \
--ignore=*.md \
--ignore=/var/www/html/*/custom/*/*.info.yml \
/var/www/html/modules/custom \
/var/www/html/themes/custom \
/var/www/html/profiles/wxt/modules/custom
./docker/bin/phpcs --standard=/var/www/html/core/phpcs.xml \
--extensions=php,module,inc,install,test,profile,theme \
--report=full \
--colors \
--ignore=*.md \
-l \
/var/www/html/profiles/wxt
phpunit:
./docker/bin/phpunit --colors=always \
--testsuite=kernel \
--group wxt
./docker/bin/phpunit --colors=always \
--testsuite=unit \
--group wxt
test: lint phpcs phpunit behat
up:
docker-machine start default
eval $$(docker-machine env default)
docker-compose up -d
update: base
git pull origin 8.x
composer update
docker-compose build --no-cache
docker-compose up -d
release: tag_latest
@if ! docker images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
docker push $(NAME)
@echo "*** Don't forget to create a tag. git tag rel-$(VERSION) && git push origin rel-$(VERSION)"
tag_latest:
docker tag -f $(NAME):$(VERSION) $(NAME):latest
.PHONY: \
all \
base \
behat \
build \
clean \
drupal_cs \
drupal_install \
drupal_migrate \
drush_archive \
env \
lint \
list \
phpcs \
phpunit \
release \
tag_latest \
test \
up \
update