1
0
mirror of https://github.com/zokradonh/kopano-docker.git synced 2026-08-11 16:32:59 +00:00

Smaller optimisations (#137)

* add docker pull to warm up build cache on travis
* explicitly build multi stage build stages
* make create repo script dynamic in the choice of the distribution
This commit is contained in:
Felix Bartels
2019-04-05 08:48:32 -05:00
committed by GitHub
parent de704dd8ec
commit b75403f69a
4 changed files with 58 additions and 7 deletions
+7 -3
View File
@@ -1,6 +1,7 @@
#!/bin/bash
set -eu
#set -x
function urldecode { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
@@ -9,10 +10,12 @@ function version_from_filename {
}
function h5ai_query {
component="$1"
component=${1:-core}
distribution=${2:-Debian_9.0}
filename=$(curl -s -S -L -d "action=get&items%5Bhref%5D=%2Fcommunity%2F$component%3A%2F&items%5Bwhat%5D=1" -H \
"Accept: application/json" https://download.kopano.io/community/ | jq '.items[].href' | \
grep 'Debian_9.0-all\|Debian_9.0-amd64' | sed 's#"##g' | sed "s#/community/$component:/##")
grep "$distribution-all\|$distribution-amd64" | sed 's#"##g' | sed "s#/community/$component:/##")
if [ -z "${filename// }" ]; then
echo "unknown component"
@@ -26,9 +29,10 @@ function h5ai_query {
function dl_and_package_community {
# take component as first argument and fallback to core if none given
component=${1:-core}
distribution=${2:-Debian_9.0}
# query community server by h5ai API
filename=$(h5ai_query "$component")
filename=$(h5ai_query "$component" "$distribution")
# download & extract packages
curl -s -S -L -o "$filename" https://download.kopano.io/community/"$component":/"${filename}"