Commit 5772dad2 authored by Huihui, Jonathan's avatar Huihui, Jonathan
Browse files

add stable/latest choice for docker image

parent b52ea080
Loading
Loading
Loading
Loading
+36 −3
Original line number Diff line number Diff line
@@ -22,6 +22,9 @@ BANNER="$BANNER\n package helpers"
echo -e "$BANNER\n\n"
}

COMMON_TAG=''
prompt=''

die() { 
  echo -e "\033[31mFAILURE:\033[39m $1"
  exit 1
@@ -40,8 +43,38 @@ banner
while :; do
  case $1 in 
    release)
      branch=$(git symbolic-ref -q HEAD | awk -F '/' '{ print $3 }')
      info "Currently on $branch "
      
      if [ "$branch" == "develop" ]; then
        info "Please confirm common tag is LATEST: "
        read -p "COMMON_TAG:(y/n) " prompt
        if [ "$prompt" != 'y' ]; then
          info "Exiting release script. "
          exit 1
        fi
        COMMON_TAG='latest'
      elif [ "$branch" == "main" ]; then
        info "Please confirm common tag is STABLE: "
        read -p "COMMON_TAG:(y/n) " prompt
        if [ "$prompt" != 'y' ]; then
          info "Exiting release script. "
          exit 1
        fi
        COMMON_TAG='stable'
      else
        info "Branch is not main or develop, currently on a $branch branch"
        info "Checking out develop branch."
        git checkout develop && git pull
        info "Please confirm common tag is LATEST: "
        read -p "COMMON_TAG:(y/n) " prompt
        if [ "$prompt" != 'y' ]; then
          info "Exiting release script. "
          exit 1
        fi
        COMMON_TAG='latest'
      fi

      COMMON_VERSION=$(cat COMMON_VERSION)
      COMMON_SETUP_REGEX="s/(?<=version \= ')\d+\.\d+\.\d+/$COMMON_VERSION/g"
      COMMON_README_REGEX="s/(?<=common\=\=)\d+\.\d+\.\d+/$COMMON_VERSION/g"
@@ -55,7 +88,7 @@ while :; do
      cd ./src && ./upload.sh
      cd ..
      ./build.sh --tag "$COMMON_VERSION"
      ./build.sh
      ./build.sh --tag "$COMMON_TAG"
      git add src/setup.py README.md && \
      git commit -m 'bump common version' && \
      git push