-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from ezweb/pg10
rewrite
- Loading branch information
Showing
39 changed files
with
782 additions
and
658 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
bin/ | ||
vendor/ | ||
.idea/ | ||
/composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,17 @@ | ||
language: php | ||
language: ruby | ||
|
||
php: | ||
- "7.1" | ||
env: | ||
- DOCKER_COMPOSE_VERSION=1.22.0 | ||
|
||
addons: | ||
postgresql: "9.6" | ||
before_install: | ||
- sudo rm /usr/local/bin/docker-compose | ||
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose | ||
- chmod +x docker-compose | ||
- sudo mv docker-compose /usr/local/bin | ||
|
||
before_script: | ||
- phpenv config-add config/docker/php/behat/apc.ini | ||
- composer install | ||
- psql -c "create role admin login createdb password 'adminpassword' superuser ;" -U postgres | ||
- psql -c "create role behat login createdb password 'behatpassword';" -U postgres | ||
- psql -c 'create database behat OWNER=behat;' -U postgres | ||
- psql -c 'create database dblinker_test OWNER=behat;' -U postgres | ||
- psql -c 'create database forbidden_db;' | ||
- mysql -e 'create database dblinker_test;' | ||
- mysql -e 'create database forbidden_db;' | ||
- mysql -e 'CREATE USER "behat"@"localhost" IDENTIFIED BY "behatpassword";' | ||
- mysql -u root -e 'GRANT ALL PRIVILEGES ON dblinker_test.* TO "behat"@"localhost";' | ||
- mysql -u root -e 'FLUSH PRIVILEGES;' | ||
services: | ||
- docker | ||
|
||
script: | ||
- vendor/bin/behat -s $BEHAT_DB_DRIVER --tags $SKIP_TAGS | ||
|
||
env: | ||
- BEHAT_DB_DRIVER=mysqli SKIP_TAGS="~@skip-travis&&~@skip-travis-mysqli" DBLINKER_MYSQL_1_ENV_MYSQL_DATABASE=dblinker_test DBLINKER_MYSQL_1_PORT_3306_TCP_ADDR=127.0.0.1 DBLINKER_MYSQL_1_ENV_MYSQL_USER=behat DBLINKER_MYSQL_1_ENV_MYSQL_PASSWORD=behatpassword DBLINKER_MYSQL_1_ENV_MYSQL_ROOT_PASSWORD= | ||
- BEHAT_DB_DRIVER=pdo_mysql SKIP_TAGS="~@skip-travis&&~@skip-travis-pdo-mysql" DBLINKER_MYSQL_1_ENV_MYSQL_DATABASE=dblinker_test DBLINKER_MYSQL_1_PORT_3306_TCP_ADDR=127.0.0.1 DBLINKER_MYSQL_1_ENV_MYSQL_USER=behat DBLINKER_MYSQL_1_ENV_MYSQL_PASSWORD=behatpassword DBLINKER_MYSQL_1_ENV_MYSQL_ROOT_PASSWORD= | ||
- BEHAT_DB_DRIVER=pdo_pgsql SKIP_TAGS="~@skip-travis&&~@skip-travis-pdo-pgsql" DBLINKER_POSTGRESQL_1_ENV_POSTGRES_DATABASE=dblinker_test DBLINKER_POSTGRESQL_1_PORT_5432_TCP_ADDR=127.0.0.1 DBLINKER_POSTGRESQL_1_ENV_POSTGRES_USER=behat DBLINKER_POSTGRESQL_1_ENV_POSTGRES_PASSWORD=behatpassword DBLINKER_POSTGRES_1_ENV_POSTGRES_ROOT_USER=admin DBLINKER_POSTGRES_1_ENV_POSTGRES_ROOT_PASSWORD=adminpassword | ||
|
||
matrix: | ||
fast_finish: true | ||
- docker-compose run composer install | ||
- docker-compose run --rm behat --tags "~@skip-travis&&~@skip-travis-pdo-pgsql&&~@skip-travis-mysqli" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE db.`users` ( | ||
`name` varchar(50) NULL, | ||
`email` varchar(128) NOT NULL | ||
); | ||
|
||
INSERT INTO db.`users` (name, email) VALUES | ||
('John', '[email protected]'), | ||
('Roger', '[email protected]'), | ||
('Max', '[email protected]'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CREATE TABLE db.`users` ( | ||
`name` varchar(50) NULL, | ||
`email` varchar(128) NOT NULL | ||
); | ||
|
||
INSERT INTO db.`users` (name, email) VALUES | ||
('John', '[email protected]'), | ||
('Roger', '[email protected]'), | ||
('Max', '[email protected]'); | ||
|
||
REVOKE ALL ON db.* FROM 'slave_user'@'%'; | ||
GRANT SELECT ON *.* TO 'slave_user'@'%'; | ||
|
||
FLUSH PRIVILEGES ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE users ( | ||
name varchar(50) NULL, | ||
email varchar(128) NOT NULL | ||
); | ||
|
||
INSERT INTO users (name, email) VALUES | ||
('John', '[email protected]'), | ||
('Roger', '[email protected]'), | ||
('Max', '[email protected]'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE users ( | ||
name varchar(50) NULL, | ||
email varchar(128) NOT NULL | ||
); | ||
|
||
INSERT INTO users (name, email) VALUES | ||
('John', '[email protected]'), | ||
('Roger', '[email protected]'), | ||
('Max', '[email protected]'); | ||
|
||
REVOKE ALL ON users FROM slave_user; | ||
GRANT SELECT ON users TO slave_user; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[mysqld] | ||
max_user_connections=8 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
FROM php:7.1 | ||
FROM php:7.1-fpm-alpine | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y zlib1g-dev | ||
RUN docker-php-ext-install zip | ||
RUN docker-php-ext-install mbstring | ||
|
||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir /usr/local/bin --filename composer | ||
|
||
RUN docker-php-ext-install mbstring | ||
|
||
ENTRYPOINT ["/usr/local/bin/composer"] | ||
|
||
WORKDIR /scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM php:7.1-fpm | ||
FROM php:7.1-fpm-alpine | ||
|
||
VOLUME /scripts/vendor/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.