1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-06 15:36:40 +00:00

BugFix: incompatible version string

This commit is contained in:
zokradonh 2021-11-10 16:44:31 +01:00
parent d35edd78a5
commit c661b24764
3 changed files with 41 additions and 15 deletions

View File

@ -71,6 +71,12 @@ jobs:
push: false
tags: zokradonh/kopano_repo_helper
context: repo
# We need this custom cache implementation here. buildx driver `docker-container` supports all
# kinds of caching mechanisms but it is always trying to pull images from a registry during build.
# It is never loading from local `docker images` that we use for our `kopano_repo_helper`.
# Therefore, we use buildx driver `docker` which mimics plain old docker with full `docker images` support
# but it lacks a lot of caching options. Since there is no plan to build for different platforms
# we can stick with driver `docker`.
- name: Cache Kopano APT Packages
if: steps.apt-cache.outputs.cache-hit != 'true'
run: |
@ -79,21 +85,31 @@ jobs:
- name: Use Kopano APT Packages from cache
if: steps.apt-cache.outputs.cache-hit == 'true'
run: docker load /tmp/.kopano-repo-helper-cache/kopano_repo_helper.tar
- uses: ./.github/actions/build-component
# - name: Prepare Docker Layer Cache # TODO cache by old registry image (with BUILDKIT_INLINE_CACHE) or `docker save`
# uses: actions/cache@v2
# with:
# path: /tmp/.layer-cache
# key: ${{ runner.os }}-buildx-${{ github.sha }}
# restore-keys: ${{ runner.os }}-buildx- # also allow old caches. Docker decides if the old cache is of any use.
- name: Build base
uses: ./.github/actions/build-component
with:
push: false
component: base
- uses: ./.github/actions/build-component
- name: Build core
uses: ./.github/actions/build-component
with:
push: false
component: core
tags: ${{ steps.kopano-versions.outputs.core_version_tags }}
- uses: ./.github/actions/build-component
- name: Build webapp
uses: ./.github/actions/build-component
with:
push: false
component: webapp
tags: ${{ steps.kopano-versions.outputs.webapp_version_tags }}
- uses: ./.github/actions/build-component
- name: Build zpush
uses: ./.github/actions/build-component
with:
push: false
component: zpush

View File

@ -2,23 +2,25 @@
if [ $# -eq 0 ]
then
echo "Usage: version_dockertags.sh <component> [<distribution>] [<channel>] [<branch>]"
echo "Usage: version_dockertags.sh <repo> <component> [<distribution>] [<channel>] [<branch>]"
fi
function version_to_tags {
version=$1
result=$version
repo=$1
component=$2
version=$3
result="$repo/kopano_$component:$version"
while [[ $version == *.* ]]; do \
version=${version%.*} ; \
result="$result,$version"
result="$result,$repo/kopano_$component:$version"
done
echo $result
}
version="$( ./version.sh $@ )"
version="$( ./version.sh ${@:2} )"
echo "::set-output name=$1_version::$version"
echo "::set-output name=$1_version_tags::$(version_to_tags $version)"
echo "::set-output name=$2_version::$version"
echo "::set-output name=$2_version_tags::$(version_to_tags $1 $2 $version)"

View File

@ -8,6 +8,10 @@ if ! command -v jq > /dev/null; then
exit 1
fi
function conform_to_docker {
echo $1 | tr -c '[:alnum:]._\n\r-' '-'
}
function finish {
if [ -e "$tmpfile" ]; then
rm "$tmpfile"
@ -42,7 +46,8 @@ core)
KOPANO_CORE_REPOSITORY_URL=${KOPANO_CORE_REPOSITORY_URL:-""}
if [[ $KOPANO_CORE_REPOSITORY_URL == http* ]]; then
version=$(curl --netrc-file ./apt_auth.conf --netrc-optional -m 1 -s -S -L "$KOPANO_CORE_REPOSITORY_URL"/Packages | grep -A2 "Package: kopano-server-packages")
echo "${version##* }"
version=$(conform_to_docker $version)
echo $(conform_to_docker ${version##* })
exit
fi
;;
@ -50,7 +55,8 @@ webapp)
KOPANO_WEBAPP_REPOSITORY_URL=${KOPANO_WEBAPP_REPOSITORY_URL:-""}
if [[ $KOPANO_WEBAPP_REPOSITORY_URL == http* ]]; then
version=$(curl --netrc-file ./apt_auth.conf --netrc-optional -m 1 -s -S -L "$KOPANO_WEBAPP_REPOSITORY_URL"/Packages | grep -m1 -A1 "Package: kopano-webapp")
echo "${version##* }"
version=$(conform_to_docker $version)
echo $(conform_to_docker ${version##* })
exit
fi
;;
@ -58,7 +64,7 @@ zpush)
KOPANO_ZPUSH_REPOSITORY_URL=${KOPANO_ZPUSH_REPOSITORY_URL:-"https://download.kopano.io/zhub/z-push:/final/Debian_10/"}
if [[ $KOPANO_ZPUSH_REPOSITORY_URL == http* ]]; then
version=$(curl -m 1 -s -S -L "$KOPANO_ZPUSH_REPOSITORY_URL"/Packages | grep -m2 -A2 "Package: z-push-kopano")
echo "${version##* }"
echo $(conform_to_docker ${version##* })
exit
fi
;;
@ -66,7 +72,7 @@ meet)
KOPANO_MEET_REPOSITORY_URL=${KOPANO_MEET_REPOSITORY_URL:-""}
if [[ $KOPANO_MEET_REPOSITORY_URL == http* ]]; then
version=$(curl --netrc-file ./apt_auth.conf --netrc-optional -m 1 -s -S -L "$KOPANO_MEET_REPOSITORY_URL"/Packages | grep -A2 "Package: kopano-meet-packages")
echo "${version##* }"
echo $(conform_to_docker ${version##* })
exit
fi
;;
@ -87,4 +93,6 @@ if [ ${#versiontemp} -lt 2 ]; then
exit 1
fi
currentVersion=$(conform_to_docker $currentVersion)
echo "$currentVersion"