Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

Commit

Permalink
fix batches
Browse files Browse the repository at this point in the history
  • Loading branch information
kiorky committed Sep 20, 2024
1 parent 5392237 commit 5b59d4c
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,14 @@ SKIPPED_TAGS="$SKIP_TF|$SKIP_MINOR_OS|$SKIP_NODE|$SKIP_DOCKER|$SKIP_MINIO|$SKIP_
CURRENT_TS=$(date +%s)
IMAGES_SKIP_NS="((mailhog|postgis|pgrouting(-bare)?|^library|dejavu|(minio/(minio|mc))))"

SKIPPED_TAGS="devel|[0-9]{4}\.|[0-9]\."
AMZNLINUX_SKIPPED_TAGS="amazon[^:]+:devel|[0-9]{4}\.|[0-9]\."
SKIPPED_TAGS="$AMZNLINUX_SKIPPED_TAGS"
# (see docker-elasticsearch for example on how to use)
PROTECTED_VERSIONS=""
default_images="
library/amazonlinux
"
ONLY_ONE_MINOR="postgres|elasticsearch|nginx"
ONLY_ONE_MINOR="postgres|nginx|opensearch|elasticsearch"
PROTECTED_TAGS="corpusops/rsyslog"
find_top_node_() {
img=library/node
Expand Down Expand Up @@ -485,6 +488,10 @@ gen_image() {
is_skipped() {
local ret=1 t="$@"
if [[ -z $SKIPPED_TAGS ]];then return 1;fi
if [[ -n "${PROTECTED_VERSIONS}" ]] && ( echo "$t" | grep -E -q "$PROTECTED_VERSIONS" );then
debug "$t is protected, no skip"
return 1
fi
if ( echo "$t" | grep -E -q "$SKIPPED_TAGS" );then
ret=0
fi
Expand Down Expand Up @@ -561,7 +568,7 @@ get_image_tags() {
changed=
if [[ "x${ONLY_ONE_MINOR}" != "x" ]] && ( echo $n | grep -E -q "$ONLY_ONE_MINOR" );then
oomt=""
for ix in $(seq 0 30);do
for ix in $(seq 0 99);do
if ! ( echo "$atags" | grep -E -q "^$ix\." );then continue;fi
for j in $(seq 0 99);do
if ! ( echo "$atags" | grep -E -q "^$ix\.${j}\." );then continue;fi
Expand All @@ -584,10 +591,12 @@ get_image_tags() {
fi
if [[ -n "$selected" ]];then
for l in $(echo "$selected"|sed -e "$ d");do
if [[ -z $oomt ]];then
oomt="$l$"
else
oomt="$oomt|$l"
if [[ -z "${PROTECTED_VERSIONS}" ]] || ! ( echo "$n:$l" | grep "${PROTECTED_VERSIONS}" );then
if [[ -z $oomt ]];then
oomt="$l$"
else
oomt="$oomt|$l"
fi
fi
done
fi
Expand All @@ -600,7 +609,7 @@ get_image_tags() {
fi
if [[ -z ${SKIP_TAGS_REBUILD} ]];then
rm -f "$t"
filter_tags "$atags" > $t
filter_tags "$atags" > "$t"
fi
set -e
if [ -e "$t" ];then cat "$t";fi
Expand Down

0 comments on commit 5b59d4c

Please sign in to comment.