mirror of
https://github.com/friendica/docker
synced 2024-12-28 08:05:20 +01:00
Merge pull request #64 from nupplaphil/bug/58-version_greater
Bugfixing version_greater() method
This commit is contained in:
commit
25f988edbe
13 changed files with 51 additions and 10 deletions
|
@ -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)
|
||||
|
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.idea/
|
|
@ -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
35
.travis/test-entrypoint.sh
Executable 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
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue