diff --git a/.travis.yml b/.travis.yml index ef4bcd9..8c4f119 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,43 +16,24 @@ env: # deprecated variables - config: postgres-old.yml - POSTGRESQL_SERVER_HOST: onlyoffice-postgresql - POSTGRESQL_SERVER_PORT: 5432 - POSTGRESQL_SERVER_DB_NAME: onlyoffice - POSTGRESQL_SERVER_USER: onlyoffice - POSTGRESQL_SERVER_PASS: onlyoffice # mysql - config: mysql.yml - DB_TYPE: mysql - DB_HOST: onlyoffice-mysql - DB_PORT: 3306 # mariadb - config: mariadb.yml - DB_TYPE: mysql - DB_HOST: db - DB_PORT: 3306 # activemq - config: activemq.yml - AMQP_TYPE: activemq - AMQP_URI: amqp://guest:guest@onlyoffice-activemq # rabbitmq - config: rabbitmq.yml - AMQP_TYPE: rabbitmq - AMQP_URI: amqp://guest:guest@onlyoffice-rabbitmq # rabbitmq old variables - config: rabbitmq-old.yml - AMQP_SERVER_TYPE: rabbitmq - AMQP_SERVER_URL: amqp://guest:guest@onlyoffice-rabbitmq # redis - config: redis.yml - REDIS_SERVER_HOST: onlyoffice-redis - REDIS_SERVER_PORT: 6379 services: - docker diff --git a/tests/activemq.yml b/tests/activemq.yml index f9b4823..6c3aad7 100644 --- a/tests/activemq.yml +++ b/tests/activemq.yml @@ -1,11 +1,12 @@ -version: '2' +version: '2.1' services: onlyoffice-documentserver: container_name: onlyoffice-documentserver - image: onlyoffice/4testing-documentserver-ie:latest + build: + context: ../. environment: - - AMQP_TYPE - - AMQP_URI + - AMQP_TYPE=${AMQP_TYPE:-activemq} + - AMQP_URI=${AMQP_URI:-amqp://guest:guest@onlyoffice-activemq} stdin_open: true restart: always ports: @@ -18,8 +19,8 @@ services: container_name: onlyoffice-activemq image: webcenter/activemq:5.14.3 environment: - - ACTIVEMQ_USERS_guest - - ACTIVEMQ_GROUPS_owners + - ACTIVEMQ_USERS_guest=${ACTIVEMQ_USERS_guest:-guest} + - ACTIVEMQ_GROUPS_owners=${ACTIVEMQ_GROUPS_owners:-guest} restart: always networks: - onlyoffice diff --git a/tests/defaults.env b/tests/defaults.env deleted file mode 100644 index 070f769..0000000 --- a/tests/defaults.env +++ /dev/null @@ -1,41 +0,0 @@ -# DocumentServer Container -ONLYOFFICE_DATA_CONTAINER=true -DB_TYPE=postgres -DB_HOST=onlyoffice-postgresql -DB_PORT=5432 -DB_NAME=onlyoffice -DB_USER=onlyoffice -DB_PWD=onlyoffice -AMQP_TYPE=rabbitmq -AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq -REDIS_SERVER_HOST=onlyoffice-redis -REDIS_SERVER_PORT=6379 -JWT_ENABLED=true -JWT_SECRET=secret -JWT_HEADER=Authorization - -ONLYOFFICE_DATA_CONTAINER_HOST=onlyoffice-documentserver-data -BALANCE=uri depth 3 -EXCLUDE_PORTS=443 -HTTP_CHECK=GET /healthcheck -EXTRA_SETTINGS=http-check expect string true -FORCE_SSL=true - -# HAProxy Container -MODE=http -CERT_FOLDER=/certs/ - -# ActiveMQ Container -ACTIVEMQ_USERS_guest=guest -ACTIVEMQ_GROUPS_owners=guest - -# Postgres Container -POSTGRES_DB=onlyoffice -POSTGRES_USER=onlyoffice -POSTGRES_HOST_AUTH_METHOD=trust - -# MySQL Container -MYSQL_DATABASE=onlyoffice -MYSQL_USER=onlyoffice -MYSQL_PASSWORD=onlyoffice -MYSQL_ALLOW_EMPTY_PASSWORD=yes \ No newline at end of file diff --git a/tests/mariadb.yml b/tests/mariadb.yml index c243fb2..91131e2 100644 --- a/tests/mariadb.yml +++ b/tests/mariadb.yml @@ -1,30 +1,31 @@ -version: '2' +version: '2.1' services: ds: container_name: ds - image: onlyoffice/4testing-documentserver-ie:latest + build: + context: ../. depends_on: - - db + - onlyoffice-mariadb environment: - - DB_TYPE - - DB_HOST - - DB_PORT - - DB_NAME - - DB_USER - - DB_PWD + - DB_TYPE=${DB_TYPE:-mysql} + - DB_HOST=${DB_HOST:-onlyoffice-mariadb} + - DB_PORT=${DB_PORT:-3306} + - DB_NAME=${DB_NAME:-onlyoffice} + - DB_USER=${DB_USER:-onlyoffice} + - DB_PWD=${DB_PWD:-onlyoffice} stdin_open: true restart: always ports: - '80:80' - db: - container_name: db + onlyoffice-mariadb: + container_name: onlyoffice-mariadb image: mariadb:10.5 environment: - - MYSQL_DATABASE - - MYSQL_USER - - MYSQL_PASSWORD - - MYSQL_ALLOW_EMPTY_PASSWORD + - MYSQL_DATABASE=${MYSQL_DATABASE:-onlyoffice} + - MYSQL_USER=${MYSQL_USER:-onlyoffice} + - MYSQL_PASSWORD=${MYSQL_PASSWORD:-onlyoffice} + - MYSQL_ALLOW_EMPTY_PASSWORD=${MYSQL_ALLOW_EMPTY_PASSWORD:-yes} restart: always volumes: - mysql_data:/var/lib/mysql diff --git a/tests/mysql.yml b/tests/mysql.yml index 9a4155f..1389a89 100644 --- a/tests/mysql.yml +++ b/tests/mysql.yml @@ -1,17 +1,18 @@ -version: '2' +version: '2.1' services: onlyoffice-documentserver: container_name: onlyoffice-documentserver - image: onlyoffice/4testing-documentserver-ie:latest + build: + context: ../. depends_on: - onlyoffice-mysql environment: - - DB_TYPE - - DB_HOST - - DB_PORT - - DB_NAME - - DB_USER - - DB_PWD + - DB_TYPE=${DB_TYPE:-mysql} + - DB_HOST=${DB_HOST:-onlyoffice-mysql} + - DB_PORT=${DB_PORT:-3306} + - DB_NAME=${DB_NAME:-onlyoffice} + - DB_USER=${DB_USER:-onlyoffice} + - DB_PWD=${DB_PWD:-onlyoffice} stdin_open: true restart: always ports: @@ -21,10 +22,10 @@ services: container_name: onlyoffice-mysql image: mysql:5.7 environment: - - MYSQL_DATABASE - - MYSQL_USER - - MYSQL_PASSWORD - - MYSQL_ALLOW_EMPTY_PASSWORD + - MYSQL_DATABASE=${MYSQL_DATABASE:-onlyoffice} + - MYSQL_USER=${MYSQL_USER:-onlyoffice} + - MYSQL_PASSWORD=${MYSQL_PASSWORD:-onlyoffice} + - MYSQL_ALLOW_EMPTY_PASSWORD=${MYSQL_ALLOW_EMPTY_PASSWORD:-yes} restart: always volumes: - mysql_data:/var/lib/mysql diff --git a/tests/postgres-old.yml b/tests/postgres-old.yml index f795107..237246c 100644 --- a/tests/postgres-old.yml +++ b/tests/postgres-old.yml @@ -1,16 +1,17 @@ -version: '2' +version: '2.1' services: onlyoffice-documentserver: container_name: onlyoffice-documentserver - image: onlyoffice/4testing-documentserver-ie:latest + build: + context: ../. depends_on: - onlyoffice-postgresql environment: - - POSTGRESQL_SERVER_HOST - - POSTGRESQL_SERVER_PORT - - POSTGRESQL_SERVER_DB_NAME - - POSTGRESQL_SERVER_USER - - POSTGRESQL_SERVER_PASS + - POSTGRESQL_SERVER_HOST=${DB_HOST:-onlyoffice-postgresql} + - POSTGRESQL_SERVER_PORT=${DB_PORT:-5432} + - POSTGRESQL_SERVER_DB_NAME=${DB_NAME:-onlyoffice} + - POSTGRESQL_SERVER_USER=${DB_USER:-onlyoffice} + - POSTGRESQL_SERVER_PASS=${DB_PWD:-onlyoffice} stdin_open: true restart: always ports: @@ -20,9 +21,9 @@ services: container_name: onlyoffice-postgresql image: postgres:9.5 environment: - - POSTGRES_DB - - POSTGRES_USER - - POSTGRES_HOST_AUTH_METHOD + - POSTGRES_DB=${POSTGRES_DB:-onlyoffice} + - POSTGRES_USER=${POSTGRES_USER:-onlyoffice} + - POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust} restart: always expose: - '5432' diff --git a/tests/postgres.yml b/tests/postgres.yml index ed16e43..6ddf134 100644 --- a/tests/postgres.yml +++ b/tests/postgres.yml @@ -1,17 +1,18 @@ -version: '2' +version: '2.1' services: onlyoffice-documentserver: container_name: onlyoffice-documentserver - image: onlyoffice/4testing-documentserver-ie:latest + build: + context: ../. depends_on: - onlyoffice-postgresql environment: - - DB_TYPE - - DB_HOST - - DB_PORT - - DB_NAME - - DB_USER - - DB_PWD + - DB_TYPE=${DB_TYPE:-postgres} + - DB_HOST=${DB_HOST:-onlyoffice-postgresql} + - DB_PORT=${DB_PORT:-5432} + - DB_NAME=${DB_NAME:-onlyoffice} + - DB_USER=${DB_USER:-onlyoffice} + - DB_PWD=${DB_PWD:-onlyoffice} stdin_open: true restart: always ports: @@ -21,9 +22,9 @@ services: container_name: onlyoffice-postgresql image: postgres:9.5 environment: - - POSTGRES_DB - - POSTGRES_USER - - POSTGRES_HOST_AUTH_METHOD + - POSTGRES_DB=${POSTGRES_DB:-onlyoffice} + - POSTGRES_USER=${POSTGRES_USER:-onlyoffice} + - POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust} restart: always expose: - '5432' diff --git a/tests/rabbitmq-old.yml b/tests/rabbitmq-old.yml index 9301ae4..ce18691 100644 --- a/tests/rabbitmq-old.yml +++ b/tests/rabbitmq-old.yml @@ -1,11 +1,12 @@ -version: '2' +version: '2.1' services: onlyoffice-documentserver: container_name: onlyoffice-documentserver - image: onlyoffice/4testing-documentserver-ie:latest + build: + context: ../. environment: - - AMQP_SERVER_TYPE - - AMQP_SERVER_URL + - AMQP_SERVER_TYPE=${AMQP_SERVER_TYPE:-rabbitmq} + - AMQP_SERVER_URL=${AMQP_SERVER_URL:-amqp://guest:guest@onlyoffice-rabbitmq} stdin_open: true restart: always ports: diff --git a/tests/rabbitmq.yml b/tests/rabbitmq.yml index 9006cb0..f73501f 100644 --- a/tests/rabbitmq.yml +++ b/tests/rabbitmq.yml @@ -1,11 +1,12 @@ -version: '2' +version: '2.1' services: onlyoffice-documentserver: container_name: onlyoffice-documentserver - image: onlyoffice/4testing-documentserver-ie:latest + build: + context: ../. environment: - - AMQP_TYPE - - AMQP_URI + - AMQP_TYPE=${AMQP_TYPE:-rabbitmq} + - AMQP_URI=${AMQP_URI:-amqp://guest:guest@onlyoffice-rabbitmq} stdin_open: true restart: always ports: diff --git a/tests/redis.yml b/tests/redis.yml index 2984ffe..9405b72 100644 --- a/tests/redis.yml +++ b/tests/redis.yml @@ -1,11 +1,12 @@ -version: '2' +version: '2.1' services: onlyoffice-documentserver: container_name: onlyoffice-documentserver - image: onlyoffice/4testing-documentserver-ie:latest + build: + context: ../. environment: - - REDIS_SERVER_HOST - - REDIS_SERVER_PORT + - REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-onlyoffice-redis} + - REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-6379} stdin_open: true restart: always ports: diff --git a/tests/test.sh b/tests/test.sh index 49d57c3..4bd15fa 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -6,16 +6,6 @@ if [[ ! -f $config ]]; then exit 1 fi -env_file=defaults.env - -# Copy .env -if [[ -f $env_file ]]; then - cp $env_file .env -else - echo "File $env_file doesn't exist!" - exit 1 -fi - # Run test environment docker-compose -p ds -f $config up -d