mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-27 04:16:45 +01:00
Add support for checking latest version of unifi (#356)
This commit is contained in:
parent
9c38f37fa4
commit
444d00e98a
|
@ -53,12 +53,30 @@ get_latest() {
|
|||
|
||||
local current=$(cat "${dir}/Dockerfile" | grep -m 1 VERSION | awk '{print $(NF)}')
|
||||
|
||||
compare "$name" "$dir" "$tag" "$current" "https://github.com/${repo}/releases"
|
||||
}
|
||||
|
||||
get_latest_unifi() {
|
||||
local latest current
|
||||
latest=$(curl -sSL http://www.ubnt.com/downloads/unifi/debian/dists/cloudkey-stable/ubiquiti/binary-armhf/Packages \
|
||||
| awk 'BEGIN {FS="\n"; RS="";} /^Package: unifi/' \
|
||||
| awk '/^Version:/ {print $2}' \
|
||||
| cut -d- -f1)
|
||||
|
||||
current=$(grep -m 1 UNIFI_VERSION unifi/Dockerfile | tr '"' ' ' | awk '{print $(NF)}')
|
||||
|
||||
compare unifi unifi "$latest" "$current" https://www.ubnt.com/download/unifi
|
||||
}
|
||||
|
||||
compare() {
|
||||
local name="$1" dir="$2" tag="$3" current="$4" releases="$5"
|
||||
|
||||
if [[ "$tag" =~ "$current" ]] || [[ "$name" =~ "$current" ]] || [[ "$current" =~ "$tag" ]] || [[ "$current" == "master" ]]; then
|
||||
echo -e "\e[36m${dir}:\e[39m current ${current} | ${tag} | ${name}"
|
||||
else
|
||||
# add to the bad versions
|
||||
bad_versions+=( "${dir}" )
|
||||
echo -e "\e[31m${dir}:\e[39m current ${current} | ${tag} | ${name} | https://github.com/${repo}/releases"
|
||||
echo -e "\e[31m${dir}:\e[39m current ${current} | ${tag} | ${name} | ${releases}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -91,12 +109,19 @@ znc/znc
|
|||
apache/zookeeper
|
||||
)
|
||||
|
||||
other_projects=(
|
||||
unifi
|
||||
)
|
||||
|
||||
bad_versions=()
|
||||
|
||||
main() {
|
||||
for p in ${projects[@]}; do
|
||||
get_latest "$p"
|
||||
done
|
||||
for p in ${other_projects[@]}; do
|
||||
get_latest_"$p"
|
||||
done
|
||||
|
||||
if [[ ${#bad_versions[@]} -ne 0 ]]; then
|
||||
echo
|
||||
|
|
Loading…
Reference in New Issue
Block a user