Skip to content

Commit c8f8036

Browse files
author
David Ferlay
authored
Merge branch 'master' into blackfire
2 parents 03e99f9 + 7a7df6a commit c8f8036

File tree

9 files changed

+65
-56
lines changed

9 files changed

+65
-56
lines changed

.env.default

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ IMAGE_REDIS=redis:5-alpine
1818
IMAGE_DRIVER=zenika/alpine-chrome
1919
CLEAR_FRONT_PACKAGES=no
2020
ADD_PHP_EXT=
21+
#ADD_PHP_EXT=php7-pdo_pgsql postgresql-client postgresql-contrib gnu-libiconv wkhtmltopdf
2122
MAIN_DOMAIN_NAME=docker.localhost
2223
DB_URL=sqlite:./../.cache/d8.sqlite
2324
# Faster but data will be lost on php container recreation
2425
#DB_URL=sqlite:///dev/shm/d8.sqlite
2526
#DB_URL=mysql://d8:d8@mysql/d8
27+
#DB_URL=pgsql://d9:d9root@postgresql/d9
2628
# Include path to this folder to your .gitignore if you override it
2729
DB_DATA_DIR=../.cache
2830
#DB_DATA_DIR=/dev/shm

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ docker/docker-compose.override.yml
1717
behat.yml
1818
features/*.html
1919
features/*.png
20+
features/junit/
2021
.cache/
2122
.editorconfig
2223
.gitattributes

.gitlab-ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,15 @@ test:behat:
257257
script:
258258
- echo "Starting job script in ${BUILD_DIR}"
259259
- cd ${BUILD_DIR}
260-
- make behat
260+
- BEHAT_ARGS='--colors -f pretty -o std -f junit -o features/junit' make behat
261261
after_script:
262262
- cd ${BUILD_DIR}
263263
- make browser_driver_stop
264264
- rm -rf web/screenshots
265265
- mkdir web/screenshots
266266
- mv features/*.png web/screenshots/
267267
- echo "- Screenshots are available here :" && cd web/screenshots && ls -h *.png | xargs -i echo "${CI_ENVIRONMENT_URL}/screenshots/{}"
268+
- mv ${BUILD_DIR}/features/junit ${CI_PROJECT_DIR}
268269
retry:
269270
max: 2
270271
when: script_failure
@@ -273,6 +274,13 @@ test:behat:
273274
allow_failure: false
274275
<<: *runner_tag_selection
275276
<<: *only_branches
277+
artifacts:
278+
expire_in: 1 week
279+
when: always
280+
paths:
281+
- junit/*.xml
282+
reports:
283+
junit: junit/*.xml
276284

277285
test:cinsp:
278286
stage: tests

Makefile

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ CGID ?= $(LOCAL_GID)
2424
# Define network name.
2525
COMPOSE_NET_NAME := $(COMPOSE_PROJECT_NAME)_front
2626

27-
# Determine mysql data directory if defined
28-
ifeq ($(shell docker-compose config --services | grep mysql),mysql)
29-
MYSQL_DIR=$(shell cd docker && realpath $(DB_DATA_DIR))/$(COMPOSE_PROJECT_NAME)_mysql
27+
SDC_SERVICES=$(shell docker-compose config --services)
28+
# Determine database data directory if defined
29+
ifeq ($(findstring mysql,$(SDC_SERVICES)),mysql)
30+
DB_MOUNT_DIR=$(shell cd docker && realpath $(DB_DATA_DIR))/$(COMPOSE_PROJECT_NAME)_mysql
31+
endif
32+
ifeq ($(findstring postgresql,$(SDC_SERVICES)),postgresql)
33+
DB_MOUNT_DIR=$(shell cd docker && realpath $(DB_DATA_DIR))/$(COMPOSE_PROJECT_NAME)_pgsql
3034
endif
3135

3236
# Define current directory only once
@@ -59,21 +63,27 @@ ifeq ($(strip $(COMPOSE_PROJECT_NAME)),projectname)
5963
$(info Please review your project settings and run `make all` again.)
6064
exit 1
6165
endif
62-
ifdef MYSQL_DIR
63-
mkdir -p $(MYSQL_DIR) && chmod 777 $(MYSQL_DIR)
66+
ifdef DB_MOUNT_DIR
67+
$(shell [ ! -d $(DB_MOUNT_DIR) ] && mkdir -p $(DB_MOUNT_DIR) && chmod 777 $(DB_MOUNT_DIR))
6468
endif
6569
make -s down
6670
@echo "Updating containers..."
6771
docker-compose pull
6872
@echo "Build and run containers..."
6973
docker-compose up -d --remove-orphans
70-
$(call php-0, apk add --no-cache graphicsmagick $(ADD_PHP_EXT))
74+
$(call php-0, apk add --no-cache graphicsmagick tzdata $(ADD_PHP_EXT))
75+
# Set up timezone
76+
$(call php-0, cp /usr/share/zoneinfo/Europe/Paris /etc/localtime)
7177
$(call php-0, kill -USR2 1)
7278
$(call php, composer global require -o --update-no-dev --no-suggest "hirak/prestissimo:^0.3")
7379

7480
## Install backend dependencies
7581
back:
76-
docker-compose up -d --remove-orphans php # PHP container is required for composer
82+
docker-compose up -d --remove-orphans --no-deps php # PHP container is required for composer
83+
ifneq ($(strip $(ADD_PHP_EXT)),)
84+
# Install additional php extensions as this goal used in CI (todo stop doing it)
85+
$(call php-0, apk add --no-cache $(ADD_PHP_EXT))
86+
endif
7787
ifeq ($(INSTALL_DEV_DEPENDENCIES), TRUE)
7888
@echo "INSTALL_DEV_DEPENDENCIES=$(INSTALL_DEV_DEPENDENCIES)"
7989
@echo "Installing composer dependencies, including dev ones"
@@ -142,9 +152,9 @@ clean: info
142152
make -s down
143153
$(eval SCAFFOLD = $(shell docker run --rm -v $(CURDIR):/mnt -w /mnt --user $(CUID):$(CGID) $(IMAGE_PHP) composer run-script list-scaffold-files | grep -P '^(?!>)'))
144154
@docker run --rm --user 0:0 -v $(CURDIR):/mnt -w /mnt -e RMLIST="$(addprefix web/,$(SCAFFOLD)) $(DIRS)" $(IMAGE_PHP) sh -c 'for i in $$RMLIST; do rm -fr $$i && echo "Removed $$i"; done'
145-
ifdef MYSQL_DIR
146-
@echo "Removing mysql data from $(MYSQL_DIR) ..."
147-
docker run --rm --user 0:0 -v $(shell dirname $(MYSQL_DIR)):/mnt $(IMAGE_PHP) sh -c "rm -fr /mnt/`basename $(MYSQL_DIR)`"
155+
ifdef DB_MOUNT_DIR
156+
@echo "Clean-up database data from $(DB_MOUNT_DIR) ..."
157+
docker run --rm --user 0:0 -v $(shell dirname $(DB_MOUNT_DIR)):/mnt $(IMAGE_PHP) sh -c "rm -fr /mnt/`basename $(DB_MOUNT_DIR)`"
148158
endif
149159
ifeq ($(CLEAR_FRONT_PACKAGES), yes)
150160
make clear-front

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
## Quickstart
3737

3838
* Install docker for <a href="https://docs.docker.com/install/" target="_blank">Linux</a>, <a href="https://docs.docker.com/docker-for-mac/install/" target="_blank">Mac</a>, <a href="https://docs.docker.com/docker-for-windows/install/" target="_blank">Windows</a>
39-
* Check <a href="https://docs.docker.com/install/linux/linux-postinstall/" target="_blank">post-installation steps for Linux</a>
40-
* Install <a href="https://docs.docker.com/compose/install/" target="_blank">docker compose</a>
39+
* Check <a href="https://docs.docker.com/install/linux/linux-postinstall/" target="_blank">post-installation steps for Linux</a> version 17.12.0 or later
40+
* Install <a href="https://docs.docker.com/compose/install/" target="_blank">docker compose</a> version 1.21.0 or later
4141

4242
* Copy **.env.default** to **.env**, more information about enviroment file can be found <a href="https://docs.docker.com/compose/env-file/" target="_blank">docs.docker.com</a>
4343
* Copy **docker-compose.override.yml.default** to **docker-compose.override.yml**, update parts you want to overwrite.

composer.json

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,13 @@
1313
{
1414
"type": "composer",
1515
"url": "https://packages.drupal.org/8"
16-
},
17-
{
18-
"type": "package",
19-
"package": {
20-
"name": "drupal/lb_ux",
21-
"version": "dev-8.x-1.x",
22-
"type": "drupal-module",
23-
"source": {
24-
"url": "https://git.drupalcode.org/project/lb_ux.git",
25-
"type": "git",
26-
"reference": "8.x-1.x"
27-
}
28-
}
29-
},
30-
{
31-
"type": "package",
32-
"package": {
33-
"name": "drupal/panels_everywhere",
34-
"version": "dev-8.x-4.x",
35-
"type": "drupal-module",
36-
"source": {
37-
"url": "https://git.drupalcode.org/project/panels_everywhere.git",
38-
"type": "git",
39-
"reference": "8.x-4.x"
40-
}
41-
}
4216
}
4317
],
4418
"require": {
4519
"composer/installers": "^1.9",
4620
"cweagans/composer-patches": "^1.6.5",
4721
"drupal/better_normalizers": "^1.0@beta",
48-
"drupal/block_content_permissions": "1.x-dev",
22+
"drupal/block_content_permissions": "^1",
4923
"drupal/core-composer-scaffold": "^9.0",
5024
"drupal/core-project-message": "^9.0",
5125
"drupal/core-recommended": "^9",
@@ -58,13 +32,13 @@
5832
"drupal/layout_builder_modal": "^1.1",
5933
"drupal/layout_builder_restrictions": "^2.7",
6034
"drupal/layout_library": "^1.0@beta",
61-
"drupal/lb_ux": "dev-8.x-1.x",
35+
"drupal/lb_ux": "1.x-dev",
6236
"drupal/manage_display": "^1.0@alpha",
6337
"drupal/menu_admin_per_menu": "^1.1",
64-
"drupal/menu_link_attributes": "1.x-dev",
38+
"drupal/menu_link_attributes": "^1.1",
6539
"drupal/page_manager": "^4.0.0-beta6",
6640
"drupal/panels": "^4.6",
67-
"drupal/panels_everywhere": "dev-8.x-4.x",
41+
"drupal/panels_everywhere": "^4.0@beta",
6842
"drupal/paragraphs": "^1.11",
6943
"drupal/pathauto": "^1.8",
7044
"drupal/rabbit_hole": "^1.0.0-beta7",
@@ -78,7 +52,7 @@
7852
"drupal/webform": "^6",
7953
"drush/drush": "^10.1.0",
8054
"skilldlabs/drupal-cleanup": "^1",
81-
"zaporylie/composer-drupal-optimizations": "^1.0"
55+
"zaporylie/composer-drupal-optimizations": "^1.1.2"
8256
},
8357
"require-dev": {
8458
"dmore/behat-chrome-extension": "^1.3",
@@ -98,8 +72,6 @@
9872
"config": {
9973
"sort-packages": true,
10074
"preferred-install": {
101-
"drupal/lb_ux": "source",
102-
"drupal/panels_everywhere": "source",
10375
"*": "dist"
10476
}
10577
},
@@ -152,7 +124,8 @@
152124
"drupal-module": [
153125
"tests",
154126
"src/Tests"
155-
]
127+
],
128+
"exclude": []
156129
},
157130
"patches": {
158131
"drupal/core": {
@@ -182,14 +155,13 @@
182155
},
183156
"drupal/lb_ux": {
184157
"Cog icon not showing when Preview disabled": "https://www.drupal.org/files/issues/2020-05-22/3116402-8.patch",
185-
"Errors when using with modules that alter a section's contextual menu": "https://www.drupal.org/files/issues/2020-05-22/3106939-4.patch",
186-
"Indicate Drupal 8/9 compatibility via core_version_requirement": "https://www.drupal.org/files/issues/2020-05-22/d9_compatibility-3138698-4.patch"
158+
"Errors when using with modules that alter a section's contextual menu": "https://www.drupal.org/files/issues/2020-05-22/3106939-4.patch"
187159
},
188160
"drupal/menu_link_attributes": {
189161
"Add missing schema for menu_link_attributes": "https://patch-diff.githubusercontent.com/raw/yannickoo/menu_link_attributes/pull/52.patch"
190162
},
191-
"drupal/panels_everywhere": {
192-
"Drupal 9 compatibility fixes for Panels Everywhere": "https://www.drupal.org/files/issues/2020-05-14/d9-compatibility-3111407-7.patch"
163+
"drupal/upgrade_status": {
164+
"Exclude node_modules from scan": "https://www.drupal.org/files/issues/2020-08-14/3162997-8.patch"
193165
}
194166
}
195167
}

docker/docker-compose.override.yml.default

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "2.1"
1+
version: "2.4"
22

33
services:
44

@@ -14,6 +14,7 @@ services:
1414
- "./90-mail.ini:/etc/php7/conf.d/90-mail.ini:z"
1515
# depends_on:
1616
# - mysql
17+
# - postgresql
1718
# Uncomment next line if you need PHP XDebug.
1819
# command: php-fpm7 -F -d zend_extension=xdebug.so
1920

@@ -58,6 +59,20 @@ services:
5859
# MYSQL_ROOT_PASSWORD: d8root
5960
# restart: always
6061
# networks:
62+
# - front
63+
64+
# postgresql:
65+
# image: postgres:12.2-alpine
66+
# container_name: "${COMPOSE_PROJECT_NAME}_pgsql"
67+
# volumes:
68+
# - ${DB_DATA_DIR}/${COMPOSE_PROJECT_NAME}_pgsql:/var/lib/postgresql/data:Z
69+
# environment:
70+
# POSTGRES_DB: d9
71+
# POSTGRES_USER: d9
72+
# POSTGRES_PASSWORD: d9root
73+
# PGDATA: /var/lib/postgresql/data
74+
# restart: always
75+
# networks:
6176
# - front
6277

6378
mailhog:

docker/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "2.1"
1+
version: "2.4"
22

33
services:
44

@@ -47,7 +47,7 @@ services:
4747
# redis:
4848
# image: ${IMAGE_REDIS}
4949
# container_name: "${COMPOSE_PROJECT_NAME}_redis"
50-
# command: redis-server --requirepass ${REDIS_PASSWD}
50+
# command: redis-server --maxmemory-policy allkeys-lru --requirepass ${REDIS_PASSWD}
5151
# restart: always
5252
# networks:
5353
# - front

scripts/makefile/tests.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ phpcsexec = docker run --rm \
66
skilldlabs/docker-phpcs-drupal ${1} -s --colors \
77
--standard=Drupal,DrupalPractice \
88
--extensions=php,module,inc,install,profile,theme,yml,txt,md,js \
9-
--ignore=*.css,libraries/*,dist/*,README.md,README.txt,node_modules/*,work/themes/**.js,work/themes/**.md \
9+
--ignore=*.css,libraries/*,dist/*,styleguide/*,README.md,README.txt,node_modules/*,work/themes/**.js,work/themes/**.md \
1010
.
1111

1212
## Validate codebase with phpcs sniffers to make sure it conforms https://www.drupal.org/docs/develop/standards
@@ -125,6 +125,7 @@ else
125125
endif
126126

127127
## Validate Behat scenarios
128+
BEHAT_ARGS ?= --colors
128129
behat:
129130
@echo "Getting base url"
130131
ifdef REVIEW_DOMAIN
@@ -143,7 +144,7 @@ endif
143144
@echo "Running Behat scenarios against http://$(BASE_URL)"
144145
$(call php, composer install -o)
145146
$(call php, vendor/bin/behat -V)
146-
$(call php, vendor/bin/behat --colors) || $(call php, vendor/bin/behat --colors --rerun)
147+
$(call php, vendor/bin/behat $(BEHAT_ARGS)) || $(call php, vendor/bin/behat $(BEHAT_ARGS) --rerun)
147148
make browser_driver_stop
148149

149150
## List existing behat definitions

0 commit comments

Comments
 (0)