diff --git a/Dockerfile b/Dockerfile index 2a52019..06ffd4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,20 +63,21 @@ COPY run-document-server.sh /app/ds/run-document-server.sh EXPOSE 80 443 -ARG REPO_URL="deb http://download.onlyoffice.com/repo/debian squeeze main" ARG COMPANY_NAME=onlyoffice ARG PRODUCT_NAME=documentserver +ARG PACKAGE_URL="http://download.onlyoffice.com/install/documentserver/linux/${COMPANY_NAME}-${PRODUCT_NAME}_amd64.deb" ENV COMPANY_NAME=$COMPANY_NAME \ PRODUCT_NAME=$PRODUCT_NAME -RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/ds.list && \ +RUN wget -q -P /tmp "$PACKAGE_URL" && \ apt-get -y update && \ service postgresql start && \ - apt-get -yq install $COMPANY_NAME-$PRODUCT_NAME && \ + apt-get -yq install /tmp/$(basename "$PACKAGE_URL") && \ service postgresql stop && \ service supervisor stop && \ chmod 755 /app/ds/*.sh && \ + rm -f /tmp/$(basename "$PACKAGE_URL") && \ rm -rf /var/log/$COMPANY_NAME && \ rm -rf /var/lib/apt/lists/* diff --git a/Makefile b/Makefile index fad186b..e1f6f5c 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,16 @@ PRODUCT_NAME ?= DocumentServer PRODUCT_VERSION ?= 0.0.0 BUILD_NUMBER ?= 0 ONLYOFFICE_VALUE ?= onlyoffice +S3_BUCKET ?= repo-doc-onlyoffice-com +RELEASE_BRANCH ?= unstable COMPANY_NAME_LOW = $(shell echo $(COMPANY_NAME) | tr A-Z a-z) PRODUCT_NAME_LOW = $(shell echo $(PRODUCT_NAME) | tr A-Z a-z) COMPANY_NAME_LOW_ESCAPED = $(subst -,,$(COMPANY_NAME_LOW)) +PACKAGE_NAME := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW) PACKAGE_VERSION := $(PRODUCT_VERSION)-$(BUILD_NUMBER) - -REPO_URL := "deb [trusted=yes] http://repo-doc-onlyoffice-com.s3.amazonaws.com/ubuntu/trusty/$(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW)/$(GIT_BRANCH)/$(PACKAGE_VERSION)/ repo/" +PACKAGE_URL := http://$(S3_BUCKET).s3.amazonaws.com/$(COMPANY_NAME_LOW)/$(RELEASE_BRANCH)/ubuntu/$(PACKAGE_NAME)_$(PACKAGE_VERSION)_amd64.deb UPDATE_LATEST := false @@ -35,12 +37,14 @@ DOCKER_TARGETS := $(foreach TAG,$(DOCKER_TAGS),$(DOCKER_REPO)$(COLON)$(TAG)) DOCKER_ARCH := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW)_$(PACKAGE_VERSION).tar.gz +DOCKER_ARCH_URI := $(COMPANY_NAME_LOW)/$(RELEASE_BRANCH)/docker/$(notdir $(DOCKER_ARCH)) + .PHONY: all clean clean-docker deploy docker publish $(DOCKER_TARGETS): $(DEB_REPO_DATA) docker build \ - --build-arg REPO_URL=$(REPO_URL) \ + --build-arg PACKAGE_URL=$(PACKAGE_URL) \ --build-arg COMPANY_NAME=$(COMPANY_NAME_LOW) \ --build-arg PRODUCT_NAME=$(PRODUCT_NAME_LOW) \ --build-arg ONLYOFFICE_VALUE=$(ONLYOFFICE_VALUE) \ @@ -67,7 +71,5 @@ deploy: $(DOCKER_TARGETS) done;) publish: $(DOCKER_ARCH) - aws s3 cp \ - $(DOCKER_ARCH) \ - s3://repo-doc-onlyoffice-com.s3.amazonaws.com/docker/amd64/ \ - --acl public-read + aws s3 cp --no-progress --acl public-read \ + $(DOCKER_ARCH) s3://$(S3_BUCKET)/$(DOCKER_ARCH_URI)