Bugfixing version_greater() method

This commit is contained in:
Philipp Holzer 2019-06-16 15:04:36 +02:00
parent 046099aba3
commit 2afdf08eed
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90
12 changed files with 50 additions and 10 deletions

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -52,6 +52,11 @@ jobs:
script:
- ./generate-stackbrew-library.sh
- <<: *test-scripts
env: SCRIPT=test-entrypoint.sh
script:
- ./.travis/test-entrypoint.sh
- stage: test images (amd64)
env: VERSION=2019.04 VARIANT=fpm-alpine ARCH=amd64
- env: VERSION=2019.04 VARIANT=fpm ARCH=amd64

35
.travis/test-entrypoint.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/sh
set -eu
# copy of see .docker-files/entrypoint.sh - testing all versions
version_greater() {
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
if ! version_greater "2019.06" "2019.06-rc"; then
exit 1;
fi
if ! version_greater "2019.06" "2019.04-rc"; then
exit 1;
fi
if version_greater "2019.06-rc" "2019.06"; then
exit 1;
fi
if version_greater "2019.04" "2019.06"; then
exit 1;
fi
if ! version_greater "2019.06" "2019.04"; then
exit 1;
fi
if ! version_greater "2019.07" "2019.06-rc"; then
exit 1;
fi
if version_greater "2019.05" "2019.06-rc"; then
exit 1;
fi
if version_greater "2019.05-dev" "2019.05"; then
exit 1;
fi
if ! version_greater "2019.05" "2019.05-dev"; then
exit 1;
fi

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)