Skip to content

Switch over to docker. #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/patches
/vendor
/bin
Makefile.local
95 changes: 95 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/usr/bin/make -f

APP_ROOT=$(CURDIR)/app
PHP=$(which php)
PHPCS_EXTENSIONS=php,module,inc,install,test,profile,theme
PHPCS_IGNORE=*.md,*.css,*.txt
PHPCS_COMMON_OPTIONS=--standard=vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml --extensions=$(PHPCS_EXTENSIONS) --ignore=$(PHPCS_IGNORE)
BUILD_LOGS_DIR=$(CURDIR)/build/logs
ARCH=$(shell uname -m)
APP_URL=http://127.0.0.1
BROWSERTEST_OUTPUT_DIRECTORY=$(APP_ROOT)/sites/default/files
PHANTOMJS_DIR=$(HOME)/.phantomjs
PHANTOMJS_BIN=$(HOME)/.phantomjs/phantomjs-2.1.1-linux-$(ARCH)/bin/phantomjs
DRUSH=$(CURDIR)/bin/drush
DC=$(CURDIR)/bin/drupal
SITE_NAME=Drupal8
[email protected]
USERNAME=admin
PASSWORD=password
PROFILE=standard
MODULES_ENABLE=0
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_DATABASE=local
MYSQL_USER=drupal
MYSQL_PASS=drupal
MYSQL_QUERY_STRING=mysql://$(MYSQL_USER):$(MYSQL_PASS)@$(MYSQL_HOST)/$(MYSQL_DATABASE)
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1n}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'

prepare:
composer install --prefer-dist

install:
$(DRUSH) -r $(APP_ROOT) site-install $(PROFILE) -y --db-url=$(MYSQL_QUERY_STRING) --sites-subdir="default" --account-mail=$(EMAIL) --account-name=$(USERNAME) --account-pass=$(PASSWORD) --site-name=$(SITE_NAME) install_configure_form.site_default_country=AU install_configure_form.date_default_timezone=Australia/Sydney

re-install: db-drop clean-up copy-files install simple-enable login

clean-up:
rm -fR $(APP_ROOT)/sites/default/files/*

copy-files:
cp $(APP_ROOT)/sites/default/default.settings.php $(APP_ROOT)/sites/default/settings.php
chmod 777 $(APP_ROOT)/sites/default/settings.php
cp $(APP_ROOT)/sites/default/default.services.yml $(APP_ROOT)/sites/default/services.yml
chmod 777 $(APP_ROOT)/sites/default/services.yml

db-drop:
$(DRUSH) -r $(APP_ROOT) sql-drop -y

simple-enable:
$(DRUSH) -r $(APP_ROOT) en simpletest --uri=$(APP_URL) -y

simple-test:
@while [ -z "$$CLASS" ]; do \
read -r -p "Class name: " CLASS; \
done ; \
$(PHP) $(APP_ROOT)/core/scripts/run-tests.sh --php $(PHP) --concurrency 12 --url $(APP_URL) --verbose --color --class '$$CLASS'

test:
$(APP_ROOT)/vendor/bin/phpunit -d -v -c $(APP_ROOT)/core/phpunit.xml.dist;cat $(APP_ROOT)/test-output.html;echo "" > $(APP_ROOT)/test-output.html

test-filter:
@while [ -z "$$GROUP" ]; do \
read -r -p "Filter group: " GROUP; \
done ; \
$(APP_ROOT)/vendor/bin/phpunit -c $(APP_ROOT)/core/phpunit.xml --filter=$$GROUP;cat $(APP_ROOT)/test-output.html;echo "" > $(APP_ROOT)/test-output.html

phantomjs: phantomjs-stop phantom-init
${PHANTOMJS_BIN} --ssl-protocol=any --ignore-ssl-errors=true $(APP_ROOT)/vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 >> /dev/null &
ps axo pid,command | grep phantomjs | grep -v grep | grep -v make

phantom-init:
if [ ! -d ${PHANTOMJS_DIR} ]; then mkdir -p ${PHANTOMJS_DIR}; wget --no-check-certificate https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-$(ARCH).tar.bz2 -O ${PHANTOMJS_DIR}/phantomjs-2.1.1-linux-x86_64.tar.bz2; tar -xvf ${PHANTOMJS_DIR}/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C ${PHANTOMJS_DIR}; else echo "PhantomJS already exists"; fi

phantomjs-stop:
ps axo pid,command | grep phantomjs | grep -v grep | grep -v make | awk '{print $$1}' | xargs -I {} kill {}
ps axo pid,command | grep php | grep -v grep | grep -v phpstorm | grep -v make | awk '{print $$1}' | xargs -I {} kill {}

login:
$(DRUSH) -r $(APP_ROOT) uli --uri=$(APP_URL)

phpcbf:
@while [ -z "$$FOLDER" ]; do \
read -r -p "Folder path: " FOLDER; \
done ; \
$(CURDIR)/bin/phpcbf --report=full $(PHPCS_COMMON_OPTIONS) $$FOLDER

phpcs:
@while [ -z "$$FOLDER" ]; do \
read -r -p "Folder path: " FOLDER; \
done ; \
$(CURDIR)/bin/phpcs --report=full $(PHPCS_COMMON_OPTIONS) $$FOLDER

-include Makefile.local
14 changes: 0 additions & 14 deletions Vagrantfile

This file was deleted.

188 changes: 0 additions & 188 deletions build.xml

This file was deleted.

7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
"name": "nickschuch/vd8",
"description": "Vagrant for Drupal 8",
"require": {
"drush/drush": "~8.1",
"phing/phing": "~2.12",
"drupal/coder": "~8.2"
"drush/drush": "^9.5"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"bin-dir": "bin/"
},
"installer-paths": {
"vendor/drupal/{$name}": ["drupal/coder"]
}
}
Loading