mirror of
https://github.com/zokradonh/kopano-docker
synced 2025-06-07 16:06:14 +00:00
BugFix: incompatible version string
This commit is contained in:
parent
d35edd78a5
commit
c661b24764
24
.github/workflows/ci.yml
vendored
24
.github/workflows/ci.yml
vendored
@ -71,6 +71,12 @@ jobs:
|
|||||||
push: false
|
push: false
|
||||||
tags: zokradonh/kopano_repo_helper
|
tags: zokradonh/kopano_repo_helper
|
||||||
context: repo
|
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
|
- name: Cache Kopano APT Packages
|
||||||
if: steps.apt-cache.outputs.cache-hit != 'true'
|
if: steps.apt-cache.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -79,21 +85,31 @@ jobs:
|
|||||||
- name: Use Kopano APT Packages from cache
|
- name: Use Kopano APT Packages from cache
|
||||||
if: steps.apt-cache.outputs.cache-hit == 'true'
|
if: steps.apt-cache.outputs.cache-hit == 'true'
|
||||||
run: docker load /tmp/.kopano-repo-helper-cache/kopano_repo_helper.tar
|
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:
|
with:
|
||||||
push: false
|
push: false
|
||||||
component: base
|
component: base
|
||||||
- uses: ./.github/actions/build-component
|
- name: Build core
|
||||||
|
uses: ./.github/actions/build-component
|
||||||
with:
|
with:
|
||||||
push: false
|
push: false
|
||||||
component: core
|
component: core
|
||||||
tags: ${{ steps.kopano-versions.outputs.core_version_tags }}
|
tags: ${{ steps.kopano-versions.outputs.core_version_tags }}
|
||||||
- uses: ./.github/actions/build-component
|
- name: Build webapp
|
||||||
|
uses: ./.github/actions/build-component
|
||||||
with:
|
with:
|
||||||
push: false
|
push: false
|
||||||
component: webapp
|
component: webapp
|
||||||
tags: ${{ steps.kopano-versions.outputs.webapp_version_tags }}
|
tags: ${{ steps.kopano-versions.outputs.webapp_version_tags }}
|
||||||
- uses: ./.github/actions/build-component
|
- name: Build zpush
|
||||||
|
uses: ./.github/actions/build-component
|
||||||
with:
|
with:
|
||||||
push: false
|
push: false
|
||||||
component: zpush
|
component: zpush
|
||||||
|
@ -2,23 +2,25 @@
|
|||||||
|
|
||||||
if [ $# -eq 0 ]
|
if [ $# -eq 0 ]
|
||||||
then
|
then
|
||||||
echo "Usage: version_dockertags.sh <component> [<distribution>] [<channel>] [<branch>]"
|
echo "Usage: version_dockertags.sh <repo> <component> [<distribution>] [<channel>] [<branch>]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function version_to_tags {
|
function version_to_tags {
|
||||||
version=$1
|
repo=$1
|
||||||
result=$version
|
component=$2
|
||||||
|
version=$3
|
||||||
|
result="$repo/kopano_$component:$version"
|
||||||
|
|
||||||
while [[ $version == *.* ]]; do \
|
while [[ $version == *.* ]]; do \
|
||||||
version=${version%.*} ; \
|
version=${version%.*} ; \
|
||||||
result="$result,$version"
|
result="$result,$repo/kopano_$component:$version"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo $result
|
echo $result
|
||||||
}
|
}
|
||||||
|
|
||||||
version="$( ./version.sh $@ )"
|
version="$( ./version.sh ${@:2} )"
|
||||||
|
|
||||||
echo "::set-output name=$1_version::$version"
|
echo "::set-output name=$2_version::$version"
|
||||||
echo "::set-output name=$1_version_tags::$(version_to_tags $version)"
|
echo "::set-output name=$2_version_tags::$(version_to_tags $1 $2 $version)"
|
||||||
|
|
||||||
|
16
version.sh
16
version.sh
@ -8,6 +8,10 @@ if ! command -v jq > /dev/null; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function conform_to_docker {
|
||||||
|
echo $1 | tr -c '[:alnum:]._\n\r-' '-'
|
||||||
|
}
|
||||||
|
|
||||||
function finish {
|
function finish {
|
||||||
if [ -e "$tmpfile" ]; then
|
if [ -e "$tmpfile" ]; then
|
||||||
rm "$tmpfile"
|
rm "$tmpfile"
|
||||||
@ -42,7 +46,8 @@ core)
|
|||||||
KOPANO_CORE_REPOSITORY_URL=${KOPANO_CORE_REPOSITORY_URL:-""}
|
KOPANO_CORE_REPOSITORY_URL=${KOPANO_CORE_REPOSITORY_URL:-""}
|
||||||
if [[ $KOPANO_CORE_REPOSITORY_URL == http* ]]; then
|
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")
|
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
|
exit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@ -50,7 +55,8 @@ webapp)
|
|||||||
KOPANO_WEBAPP_REPOSITORY_URL=${KOPANO_WEBAPP_REPOSITORY_URL:-""}
|
KOPANO_WEBAPP_REPOSITORY_URL=${KOPANO_WEBAPP_REPOSITORY_URL:-""}
|
||||||
if [[ $KOPANO_WEBAPP_REPOSITORY_URL == http* ]]; then
|
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")
|
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
|
exit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@ -58,7 +64,7 @@ zpush)
|
|||||||
KOPANO_ZPUSH_REPOSITORY_URL=${KOPANO_ZPUSH_REPOSITORY_URL:-"https://download.kopano.io/zhub/z-push:/final/Debian_10/"}
|
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
|
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")
|
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
|
exit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@ -66,7 +72,7 @@ meet)
|
|||||||
KOPANO_MEET_REPOSITORY_URL=${KOPANO_MEET_REPOSITORY_URL:-""}
|
KOPANO_MEET_REPOSITORY_URL=${KOPANO_MEET_REPOSITORY_URL:-""}
|
||||||
if [[ $KOPANO_MEET_REPOSITORY_URL == http* ]]; then
|
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")
|
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
|
exit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@ -87,4 +93,6 @@ if [ ${#versiontemp} -lt 2 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
currentVersion=$(conform_to_docker $currentVersion)
|
||||||
|
|
||||||
echo "$currentVersion"
|
echo "$currentVersion"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user