From 5ef37630c54ada5cedfc35cf33fc1341e6d19cb4 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Tue, 30 Aug 2016 17:06:02 +0300 Subject: [PATCH] Use ARG to set up documentserver repo --- Dockerfile | 4 +++- Makefile | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0e5fc74..d6c64f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ FROM ubuntu:14.04 MAINTAINER Ascensio System SIA +ARG REPO_URL="deb http://static.teamlab.com/repo/debian/ squeeze main" + ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ @@ -34,7 +36,7 @@ ADD run-document-server.sh /app/onlyoffice/run-document-server.sh EXPOSE 80 443 -RUN echo "deb http://repo-doc-onlyoffice-com.s3.amazonaws.com/ubuntu/trusty/onlyoffice-documentserver/{{GIT_BRANCH}}/{{PACKAGE_VERSION}}/ repo/" | tee /etc/apt/sources.list.d/onlyoffice.list && \ +RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/onlyoffice.list && \ apt-get -y update && \ service postgresql start && \ apt-get --force-yes -yq install onlyoffice-documentserver && \ diff --git a/Makefile b/Makefile index 4d19f2f..724126d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ PACKAGE_VERSION := $(PRODUCT_VERSION)-$(BUILD_NUMBER) +REPO_URL := "deb http://repo-doc-onlyoffice-com.s3.amazonaws.com/ubuntu/trusty/onlyoffice-documentserver/$(GIT_BRANCH)/$(PACKAGE_VERSION)/ repo/" + ifeq ($(GIT_BRANCH), origin/develop) DOCKER_TAGS += $(subst -,.,$(PACKAGE_VERSION)) DOCKER_TAGS += latest @@ -15,10 +17,8 @@ DOCKER_TARGETS := $(foreach TAG,$(DOCKER_TAGS),$(DOCKER_REPO)$(COLON)$(TAG)) .PHONY: all clean clean-docker deploy docker $(DOCKER_TARGETS): $(DEB_REPO_DATA) - sed "s|{{GIT_BRANCH}}|$(GIT_BRANCH)|" -i Dockerfile - sed 's/{{PACKAGE_VERSION}}/'$(PACKAGE_VERSION)'/' -i Dockerfile - sudo docker build -t $(subst $(COLON),:,$@) . &&\ + sudo docker build --build-arg REPO_URL=$(REPO_URL) -t $(subst $(COLON),:,$@) . &&\ mkdir -p $$(dirname $@) &&\ echo "Done" > $@