From 62424ea12059e2afb1b3d196b6cd25a2b00c425f Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Thu, 4 Jun 2020 15:15:34 +0300 Subject: [PATCH 1/3] Disable redis server for Community Edition (#255) * Disable redis server * Add REDIS_ENABLED variable * Fix Dockerfile * Fix REDIS_ENABLED condition --- Dockerfile | 3 ++- run-document-server.sh | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d996e71..5585e64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,7 +67,8 @@ ARG REPO_URL="deb http://download.onlyoffice.com/repo/debian squeeze main" ARG COMPANY_NAME=onlyoffice ARG PRODUCT_NAME=documentserver -ENV COMPANY_NAME=$COMPANY_NAME +ENV COMPANY_NAME=$COMPANY_NAME \ + PRODUCT_NAME=$PRODUCT_NAME RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/ds.list && \ apt-get -y update && \ diff --git a/run-document-server.sh b/run-document-server.sh index b040372..4a689bb 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -49,6 +49,12 @@ JWT_SECRET=${JWT_SECRET:-secret} JWT_HEADER=${JWT_HEADER:-Authorization} JWT_IN_BODY=${JWT_IN_BODY:-false} +if [[ ${PRODUCT_NAME} == "documentserver" ]]; then + REDIS_ENABLED=false +else + REDIS_ENABLED=true +fi + ONLYOFFICE_DEFAULT_CONFIG=${CONF_DIR}/local.json ONLYOFFICE_LOG4JS_CONFIG=${CONF_DIR}/log4js/production.json ONLYOFFICE_EXAMPLE_CONFIG=${CONF_DIR}-example/local.json @@ -461,7 +467,7 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then if [ ${REDIS_SERVER_HOST} != "localhost" ]; then update_redis_settings - else + elif [ ${REDIS_ENABLED} = "true" ]; then # change rights for redis directory chown -R redis:redis ${REDIS_DATA} chmod -R 750 ${REDIS_DATA} @@ -492,7 +498,9 @@ fi if [ ${ONLYOFFICE_DATA_CONTAINER} != "true" ]; then waiting_for_db waiting_for_amqp - waiting_for_redis + if [ ${REDIS_ENABLED} = "true" ]; then + waiting_for_redis + fi update_nginx_settings From 7193b651ecd90bea5e962e56d8bc43edbfc8657d Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Thu, 4 Jun 2020 17:24:07 +0300 Subject: [PATCH 2/3] Add test for Integration Edition (#256) * Add test for Integration Edition * Add test for Community Edition * Fix tests for redis * Fix edition test * Rename test --- .travis.yml | 13 ++++++++++++- tests/redis.yml | 2 ++ tests/standalone.yml | 12 ++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/standalone.yml diff --git a/.travis.yml b/.travis.yml index 94a1ff0..6018474 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,13 @@ language: generic dist: trusty env: + # community edition + - config: standalone.yml + + # integration edition + - config: standalone.yml + PRODUCT_NAME: documentserver-ie + # certificates (default tls if onlyoffice not exists) - config: certs.yml ssl: true @@ -52,9 +59,13 @@ env: # rabbitmq old variables - config: rabbitmq-old.yml - # redis + # redis with community edition - config: redis.yml + # redis with integraion edition + - config: redis.yml + PRODUCT_NAME: documentserver-ie + services: - docker diff --git a/tests/redis.yml b/tests/redis.yml index 9405b72..5f759ad 100644 --- a/tests/redis.yml +++ b/tests/redis.yml @@ -4,6 +4,8 @@ services: container_name: onlyoffice-documentserver build: context: ../. + args: + - PRODUCT_NAME=${PRODUCT_NAME:-documentserver} environment: - REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-onlyoffice-redis} - REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-6379} diff --git a/tests/standalone.yml b/tests/standalone.yml new file mode 100644 index 0000000..f3de32f --- /dev/null +++ b/tests/standalone.yml @@ -0,0 +1,12 @@ +version: '2.1' +services: + onlyoffice-documentserver: + container_name: onlyoffice-documentserver + build: + context: ../. + args: + - PRODUCT_NAME=${PRODUCT_NAME:-documentserver} + stdin_open: true + restart: always + ports: + - '80:80' From e47d6d8c1ac3ab215acdf4beda0679ae8c7e15f9 Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Wed, 17 Jun 2020 11:24:52 +0300 Subject: [PATCH 3/3] Add several attempts for docker push (#258) * Add several attempts for docker push * Fix retries, add delay --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ce11a08..fad186b 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,10 @@ clean-docker: docker rmi -f $$(docker images -q $(COMPANY_NAME_LOW)/*) || exit 0 deploy: $(DOCKER_TARGETS) - $(foreach TARGET,$(DOCKER_TARGETS),docker push $(subst $(COLON),:,$(TARGET));) + $(foreach TARGET,$(DOCKER_TARGETS), \ + for i in {1..3}; do \ + docker push $(subst $(COLON),:,$(TARGET)) && break || sleep 1m; \ + done;) publish: $(DOCKER_ARCH) aws s3 cp \