1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-07 16:06:14 +00:00

make it possible to build official kopano releases

Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
Felix Bartels 2018-11-06 12:14:11 +01:00
parent 12eb0daddc
commit 119826e180
5 changed files with 44 additions and 2 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
*.yml *.yml
docker-compose.yml docker-compose.yml
data/* data/*
env

View File

@ -9,13 +9,28 @@ core_download_version = $(shell ./version.sh core)
webapp_version = $(shell docker run --rm $(docker_repo)/kopano_webapp cat /kopano/buildversion | tail -n 1 | grep -o -P '(?<=-).*(?=\+)') webapp_version = $(shell docker run --rm $(docker_repo)/kopano_webapp cat /kopano/buildversion | tail -n 1 | grep -o -P '(?<=-).*(?=\+)')
webapp_download_version = $(shell ./version.sh webapp) webapp_download_version = $(shell ./version.sh webapp)
KOPANO_CORE_REPOSITORY_URL := file:/kopano/repo/core
KOPANO_WEBAPP_REPOSITORY_URL := file:/kopano/repo/webapp
RELEASE_KEY_DOWNLOAD := 0
DOWNLOAD_COMMUNITY_PACKAGES := 1
include env
export
# convert lowercase componentname to uppercase
COMPONENT = $(shell echo $(component) | tr a-z A-Z) COMPONENT = $(shell echo $(component) | tr a-z A-Z)
build-all: build-ssl build-base build-core build-webapp build-all: build-ssl build-base build-core build-webapp
build: component ?= base build: component ?= base
build: build:
docker build --build-arg KOPANO_$(COMPONENT)_VERSION=${$(component)_download_version} -t $(docker_repo)/kopano_$(component) $(component)/ docker build \
--build-arg KOPANO_$(COMPONENT)_VERSION=${$(component)_download_version} \
--build-arg KOPANO_CORE_REPOSITORY_URL=$(KOPANO_CORE_REPOSITORY_URL) \
--build-arg KOPANO_WEBAPP_REPOSITORY_URL=$(KOPANO_WEBAPP_REPOSITORY_URL) \
--build-arg RELEASE_KEY_DOWNLOAD=$(RELEASE_KEY_DOWNLOAD) \
--build-arg DOWNLOAD_COMMUNITY_PACKAGES=$(DOWNLOAD_COMMUNITY_PACKAGES) \
-t $(docker_repo)/kopano_$(component) $(component)/
build-base: build-base:
component=base make build component=base make build

View File

@ -3,7 +3,8 @@
New instructions: New instructions:
- explain Makefile - explain Makefile
- `make docker_repo=kopano build-all` to upload to a custom docker hub account - `make docker_repo=kopano publish` to upload to a custom docker hub account
## Getting started with docker-compose ## Getting started with docker-compose

5
env-example Normal file
View File

@ -0,0 +1,5 @@
# modify below to build a different version, than the kopano nightly release
KOPANO_CORE_REPOSITORY_URL=https://serial:xxxx@download.kopano.io/supported/core:/final/Debian_9.0/
KOPANO_WEBAPP_REPOSITORY_URL=https://serial:xxxx@download.kopano.io/supported/webapp:/final/Debian_9.0/
RELEASE_KEY_DOWNLOAD=1
DOWNLOAD_COMMUNITY_PACKAGES=0

View File

@ -8,6 +8,26 @@ source base/create-kopano-repo.sh
component=${1:-core} component=${1:-core}
if [ -e ./env ]; then
source ./env
fi
KOPANO_CORE_REPOSITORY_URL=${KOPANO_CORE_REPOSITORY_URL:-""}
KOPANO_WEBAPP_REPOSITORY_URL=${KOPANO_WEBAPP_REPOSITORY_URL:-""}
if [[ $KOPANO_CORE_REPOSITORY_URL == http* ]] || [[ $KOPANO_WEBAPP_REPOSITORY_URL == http* ]]; then
case $component in
core)
version=$(curl -s -S -L $KOPANO_CORE_REPOSITORY_URL/Packages | grep -A2 "Package: kopano-server-packages")
echo "${version##* }"
;;
webapp)
version=$(curl -s -S -L $KOPANO_WEBAPP_REPOSITORY_URL/Packages | grep -m1 -A1 "Package: kopano-webapp")
echo "${version##* }"
;;
esac
exit
fi
# query community server by h5ai API # query community server by h5ai API
filename=$(h5ai_query "$component") filename=$(h5ai_query "$component")