Skip to content

Commit

Permalink
Merge branch 'master' into feature/1332-use-MkDocs-for-docs.versionpr…
Browse files Browse the repository at this point in the history
…ess.net

# Conflicts:
#	docs/content/en/developer/dev-setup.md
  • Loading branch information
borekb committed Jun 7, 2018
2 parents c4bae26 + a491044 commit 890ae2c
Show file tree
Hide file tree
Showing 59 changed files with 4,805 additions and 8,368 deletions.
25 changes: 18 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# Build dirs
/build
# VersionPress-specific folders
/dist

node_modules
/plugins/versionpress/admin/public/gui
# IDEs
.vscode
.idea

# Other
Thumbs.db
# PHP
vendor

# Node / npm
node_modules
npm-debug.log

docker-compose.override.yml
# Various overrides
docker-compose.override.yml
phpunit.*.xml
wp-cli.local.yml

# OS-generated files
.DS_Store
Thumbs.db
Desktop.ini
4 changes: 2 additions & 2 deletions .ide-tpl/.idea-versionpress/php-docker-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<option name="volumeBindings">
<list>
<DockerVolumeBindingImpl>
<option name="containerPath" value="/opt/project" />
<option name="containerPath" value="/opt/versionpress" />
<option name="hostPath" value="$PROJECT_DIR$" />
</DockerVolumeBindingImpl>
<DockerVolumeBindingImpl>
Expand All @@ -25,4 +25,4 @@
</map>
</list>
</component>
</project>
</project>
433 changes: 83 additions & 350 deletions .ide-tpl/.idea-versionpress/php.xml

Large diffs are not rendered by default.

108 changes: 0 additions & 108 deletions .ide-tpl/.idea-versionpress/versionpress.iml
Original file line number Diff line number Diff line change
Expand Up @@ -52,113 +52,5 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="PHP" type="php">
<CLASSES>
<root url="file://$MODULE_DIR$/../../ext-libs/vendor/wp-cli" />
<root url="file://$MODULE_DIR$/../../ext-libs/wordpress" />
<root url="file://$MODULE_DIR$/vendor/10up/wp_mock" />
<root url="file://$MODULE_DIR$/vendor/antecedent/patchwork" />
<root url="file://$MODULE_DIR$/vendor/composer" />
<root url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
<root url="file://$MODULE_DIR$/vendor/fzaninotto/faker" />
<root url="file://$MODULE_DIR$/vendor/hamcrest/hamcrest-php" />
<root url="file://$MODULE_DIR$/vendor/icecave/parity" />
<root url="file://$MODULE_DIR$/vendor/icecave/repr" />
<root url="file://$MODULE_DIR$/vendor/icecave/semver" />
<root url="file://$MODULE_DIR$/vendor/michelf/php-markdown" />
<root url="file://$MODULE_DIR$/vendor/mikey179/vfsStream" />
<root url="file://$MODULE_DIR$/vendor/mockery/mockery" />
<root url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<root url="file://$MODULE_DIR$/vendor/nette/utils" />
<root url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" />
<root url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
<root url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" />
<root url="file://$MODULE_DIR$/vendor/phpmyadmin/sql-parser" />
<root url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-token-stream" />
<root url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
<root url="file://$MODULE_DIR$/vendor/phpunit/phpunit-mock-objects" />
<root url="file://$MODULE_DIR$/vendor/phpunit/phpunit-selenium" />
<root url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<root url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
<root url="file://$MODULE_DIR$/vendor/sebastian/diff" />
<root url="file://$MODULE_DIR$/vendor/sebastian/environment" />
<root url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
<root url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
<root url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
<root url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<root url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
<root url="file://$MODULE_DIR$/vendor/sebastian/version" />
<root url="file://$MODULE_DIR$/vendor/squizlabs/php_codesniffer" />
<root url="file://$MODULE_DIR$/vendor/symfony/filesystem" />
<root url="file://$MODULE_DIR$/vendor/symfony/process" />
<root url="file://$MODULE_DIR$/vendor/symfony/yaml" />
<root url="file://$MODULE_DIR$/vendor/tracy/tracy" />
<root url="file://$MODULE_DIR$/vendor/webmozart/assert" />
</CLASSES>
<SOURCES>
<root url="file://$MODULE_DIR$/../../ext-libs/vendor/wp-cli" />
<root url="file://$MODULE_DIR$/../../ext-libs/wordpress" />
<root url="file://$MODULE_DIR$/vendor/10up/wp_mock" />
<root url="file://$MODULE_DIR$/vendor/antecedent/patchwork" />
<root url="file://$MODULE_DIR$/vendor/composer" />
<root url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
<root url="file://$MODULE_DIR$/vendor/fzaninotto/faker" />
<root url="file://$MODULE_DIR$/vendor/hamcrest/hamcrest-php" />
<root url="file://$MODULE_DIR$/vendor/icecave/parity" />
<root url="file://$MODULE_DIR$/vendor/icecave/repr" />
<root url="file://$MODULE_DIR$/vendor/icecave/semver" />
<root url="file://$MODULE_DIR$/vendor/michelf/php-markdown" />
<root url="file://$MODULE_DIR$/vendor/mikey179/vfsStream" />
<root url="file://$MODULE_DIR$/vendor/mockery/mockery" />
<root url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<root url="file://$MODULE_DIR$/vendor/nette/utils" />
<root url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" />
<root url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
<root url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" />
<root url="file://$MODULE_DIR$/vendor/phpmyadmin/sql-parser" />
<root url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-token-stream" />
<root url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
<root url="file://$MODULE_DIR$/vendor/phpunit/phpunit-mock-objects" />
<root url="file://$MODULE_DIR$/vendor/phpunit/phpunit-selenium" />
<root url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<root url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
<root url="file://$MODULE_DIR$/vendor/sebastian/diff" />
<root url="file://$MODULE_DIR$/vendor/sebastian/environment" />
<root url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
<root url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
<root url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
<root url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<root url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
<root url="file://$MODULE_DIR$/vendor/sebastian/version" />
<root url="file://$MODULE_DIR$/vendor/squizlabs/php_codesniffer" />
<root url="file://$MODULE_DIR$/vendor/symfony/filesystem" />
<root url="file://$MODULE_DIR$/vendor/symfony/process" />
<root url="file://$MODULE_DIR$/vendor/symfony/yaml" />
<root url="file://$MODULE_DIR$/vendor/tracy/tracy" />
<root url="file://$MODULE_DIR$/vendor/webmozart/assert" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="PHARS">
<CLASSES>
<root url="phar://$MODULE_DIR$/vendor/phpunit/phpunit/tests/_files/phpunit-example-extension/tools/phpunit.d/phpunit-example-extension-1.0.0.phar/" />
</CLASSES>
<SOURCES>
<root url="phar://$MODULE_DIR$/vendor/phpunit/phpunit/tests/_files/phpunit-example-extension/tools/phpunit.d/phpunit-example-extension-1.0.0.phar/" />
</SOURCES>
</library>
</orderEntry>
</component>
</module>
2 changes: 0 additions & 2 deletions dev-env/.dockerignore

This file was deleted.

5 changes: 3 additions & 2 deletions dev-env/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Mapped WP site root from inside the container
/wp
/wp
/wp-for-tests
/test-logs
31 changes: 0 additions & 31 deletions dev-env/vp-entrypoint.sh

This file was deleted.

35 changes: 35 additions & 0 deletions dev-env/wordpress-cli-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM wordpress:cli

ENV XDEBUG_VERSION 2.6.0

# Switching to root first, `wordpress:cli` sets the user to www-data.
USER root

# Install newer version of Git, required for VersionPress.
RUN apk add --no-cache git

RUN apk add --no-cache $PHPIZE_DEPS \
&& pecl install xdebug-${XDEBUG_VERSION} \
&& docker-php-ext-enable xdebug \
&& { \
echo 'xdebug.remote_host=host.docker.internal'; \
echo 'xdebug.remote_enable=1'; \
echo 'xdebug.remote_autostart=0'; \
echo 'xdebug.profiler_enable=0'; \
} >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

# Docker mounts all volumes as `root` while the parent image uses www-data.
# This creates issues with file permissions, for example, WP-CLI cannot write
# to a root-owned /var/www/.wp-cli. A workaround is to create all folders that
# are going to become mount points here, see moby/moby#2259 for related discussion.
#
# ! Make sure the list of folders matches volumes in docker-compose.yml.
RUN set -ex; \
for f in /var/www/html /var/www/.wp-cli /var/opt/versionpress/logs; \
do \
mkdir -p "$f"; \
chown -R www-data:www-data "$f"; \
done

# Set the final runtime user again
USER www-data
9 changes: 3 additions & 6 deletions dev-env/Dockerfile → dev-env/wordpress-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM wordpress:4.9-php5.6-apache
FROM wordpress:php7.2-apache

# Requirements for WP-CLI & VersionPress (separate lines to make it clear)
# Install prerequisites for WP-CLI & VersionPress
RUN apt-get update \
&& apt-get install -y sudo less mysql-client \
&& apt-get install -y git \
Expand All @@ -19,10 +19,7 @@ RUN chmod +x /bin/wp-cli.phar && chmod +x /bin/wp
# Adapted from https://github.com/johnrom/docker-wordpress-wp-cli-xdebug/blob/8b87351f9b65b95734fd726e97deff45ec8c8dfc/Dockerfile
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_host=host.docker.internal" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=0" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.profiler_enable=0" >> /usr/local/etc/php/conf.d/xdebug.ini

COPY vp-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["vp-entrypoint.sh"]
CMD ["apache2-foreground"]
6 changes: 0 additions & 6 deletions docker-compose.override.example.yml

This file was deleted.

87 changes: 69 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,94 @@
version: '3.1'
version: '3.6'
services:

wordpress:
build: ./dev-env
image: versionpress/wordpress
image: versionpress/wordpress:php7.2-apache
ports:
- 8088:80
- "80:80"
volumes:
- ./plugins/versionpress:/var/www/html/wp-content/plugins/versionpress
- ./dev-env/wp:/var/www/html
depends_on:
links:
- mysql
- adminer
environment:
WORDPRESS_DB_PASSWORD: r00tpwd

# Environment variables for `wp core install`
WORDPRESS_SITEURL: http://localhost:8088
WORDPRESS_SITE_TITLE: VP Dev
WORDPRESS_ADMIN_USER: admin
WORDPRESS_ADMIN_PASSWORD: adminpwd
WORDPRESS_ADMIN_EMAIL: [email protected]
wordpress-for-tests:
image: versionpress/wordpress:php7.2-apache
ports:
- "80:80"
volumes:
- ./dev-env/wp-for-tests:/var/www/html
links:
- mysql-for-tests:mysql
working_dir: /var/www/html/wptest
environment:
WORDPRESS_DB_PASSWORD: r00tpwd

mysql:
image: mysql:5.7
ports:
- 3399:3306
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: r00tpwd


mysql-for-tests:
image: mysql:5.7
ports:
- "3306:3306"
volumes:
- db_data_for_tests:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: r00tpwd

adminer:
image: adminer
ports:
- 8099:8080
- "8099:8080"

# See `tests-with-wordpress` for a service that also starts WordPress.
tests:
image: versionpress/wordpress:cli
environment:
VP_DIR: /opt/versionpress
VP_TESTS_LOG_DIR: /var/opt/versionpress/logs/.tracy
PHP_IDE_CONFIG: serverName=VersionPress-tests
volumes:
# !!! This must be kept in sync with wordpress-cli-image/Dockerfile
- ./dev-env/test-logs:/var/opt/versionpress/logs
- ./plugins/versionpress:/opt/versionpress:ro
- ./ext-libs:/opt/ext-libs:ro
- wpcli-cache:/var/www/.wp-cli
working_dir: /opt/versionpress/tests
command: ../vendor/bin/phpunit --verbose --colors -c phpunit.xml --testdox-text /var/opt/versionpress/logs/testdox.txt

tests-with-wordpress:
image: versionpress/wordpress:cli
environment:
VP_DIR: /opt/versionpress
VP_TESTS_LOG_DIR: /var/opt/versionpress/logs/.tracy
PHP_IDE_CONFIG: serverName=VersionPress-tests
volumes:
# !!! This must be kept in sync with wordpress-cli-image/Dockerfile
- ./dev-env/wp-for-tests:/var/www/html
- ./dev-env/test-logs:/var/opt/versionpress/logs
- ./plugins/versionpress:/opt/versionpress:ro
- ./ext-libs:/opt/ext-libs:ro
- wpcli-cache:/var/www/.wp-cli
working_dir: /opt/versionpress/tests
command: ../vendor/bin/phpunit --verbose --colors -c phpunit.xml --testdox-text /var/opt/versionpress/logs/testdox.txt
links:
- mysql:db
depends_on:
- mysql
- selenium-hub
- wordpress-for-tests

selenium-hub:
# Standalone Firefox is enough but could also be a full grid setup, hence the service name
image: selenium/standalone-firefox

volumes:
db_data:
db_data:
db_data_for_tests:
wpcli-cache:
Loading

0 comments on commit 890ae2c

Please sign in to comment.