diff --git a/.env b/.env new file mode 100644 index 0000000..c2ac1ee --- /dev/null +++ b/.env @@ -0,0 +1,8 @@ +WORDPRESS_DB_NAME=test +WORDPRESS_DB_USER=test +WORDPRESS_DB_PASSWORD=test + +MYSQL_ROOT_PASSWORD=test +MYSQL_DATABASE=test +MYSQL_USER=test +MYSQL_PASSWORD=test \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d696c3b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM wordpress:php5.6 + +RUN apt-get update && apt-get install -y less wget subversion mysql-client + +RUN wget https://phar.phpunit.de/phpunit-6.5.phar && \ + chmod +x phpunit-6.5.phar && \ + mv phpunit-6.5.phar /usr/local/bin/phpunit + +RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \ + chmod +x wp-cli.phar && \ + mv wp-cli.phar /usr/local/bin/wp \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fe1f3f4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,27 @@ +version: "2" +services: + wordpress: + build: + context: . + dockerfile: Dockerfile + ports: + - "8888:80" + depends_on: + - db + environment: + WORDPRESS_DB_HOST: "db:3306" + env_file: .env + volumes: + - .:/var/www/html/wp-content/plugins/plugin + - for-testing:/tmp + db: + image: mysql:latest + env_file: .env + volumes: + - db-data:/var/lib/mysql + +volumes: + db-data: + driver: local + for-testing: + driver: local diff --git a/phpcs.ruleset.xml b/phpcs.ruleset.xml new file mode 100644 index 0000000..210c25a --- /dev/null +++ b/phpcs.ruleset.xml @@ -0,0 +1,10 @@ + + + Generally-applicable sniffs for WordPress plugins + + + + + */node_modules/* + */vendor/* +