Add stable/2310 branch to docker executor image scripts
[ci-management.git] / docker / scripts / update_dockerhub_prod_tags.sh
index 890beb3..01dac64 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/bash
 
-# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2022 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -58,11 +58,11 @@ usage() {
     echo "       $script i[nspect] <prod image>"
     echo
     echo "  revert: swaps 'prod-<arch>' and 'prod-prev-<arch>' images"
-    echo "          <prod image>: e.g. fdiotools/builder-ubuntu1804:prod-x86_64"
+    echo "          <prod image>: e.g. fdiotools/builder-ubuntu2204:prod-x86_64"
     echo
     echo " promote: moves 'prod-<arch>' image to 'prod-prev-<arch>' tag and"
     echo "          tags <new image> with 'prod-<arch>'"
-    echo "          <new image>: e.g. fdiotools/builder-ubuntu1804:2020_09_23_151655-x86_64"
+    echo "          <new image>: e.g. fdiotools/builder-ubuntu2204:2022_07_23_151655-x86_64"
     echo " inspect: prints out all tags for prod-<arch> and prod-prev-<arch>"
     echo
     exit 1
@@ -187,10 +187,8 @@ get_all_tags_from_dockerhub() {
 
 verify_image_version_date_format() {
     version="$1"
-    # TODO: Remove regex1 when legacy nomenclature is no longer on docker hub.
-    local regex1="^[0-9]{4}_[0-1][0-9]_[0-3][0-9]_[0-2][0-9][0-5][0-9][0-5][0-9]$"
-    local regex2="^[0-9]{4}_[0-1][0-9]_[0-3][0-9]_[0-2][0-9][0-5][0-9][0-5][0-9]_UTC$"
-    if [[ "$version" =~ $regex1 ]] || [[ "$version" =~ $regex2 ]]; then
+    local ver_regex="^[0-9]{4}_[0-1][0-9]_[0-3][0-9]_[0-2][0-9][0-5][0-9][0-5][0-9]_UTC$"
+    if [[ "$version" =~ $ver_regex ]]; then
         return 0
     fi
     return 1