github.com/verrazzano/verrazzano@v1.7.0/release/scripts/check_versions.sh (about)

     1  #!/usr/bin/env bash
     2  #
     3  # Copyright (c) 2021, Oracle and/or its affiliates.
     4  # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     5  #
     6  
     7  # Checks the Verrazzano development and Chart.yaml versions to make sure they are accurate
     8  
     9  usage() {
    10      cat <<EOM
    11    Checks .verrazzano-development-version and Chart.yaml files to make sure the versions are correct.
    12  
    13    Usage:
    14      $(basename $0) <version to release>
    15  
    16    Example:
    17      $(basename $0) 1.0.2
    18  
    19    This script should be run from the git repository containing the bits to release.
    20  EOM
    21      exit 0
    22  }
    23  
    24  [ -z "$1" -o "$1" == "-h" ] && { usage; }
    25  
    26  VERSION=$1
    27  PASS=true
    28  SCRIPT_DIR=$(dirname "$0")
    29  
    30  # Check .verrazzano-development-version
    31  
    32  VER=$(grep verrazzano-development-version $SCRIPT_DIR/../../.verrazzano-development-version | cut -d= -f 2)
    33  
    34  [[ "$VERSION" != "$VER" ]] && { echo "FAILED: .verrazzano-development-version has incorrect version"; PASS=false; }
    35  
    36  # Check Chart.yaml versions
    37  
    38  for f in $(find $SCRIPT_DIR/../../platform-operator/helm_config/charts/ -name Chart.yaml)
    39  do
    40      VER=$(grep 'version:' $f | cut -d: -f 2 | xargs echo -n)
    41      [[ "$VERSION" != "$VER" ]] && { echo "FAILED: $f has incorrect version"; PASS=false; }
    42  
    43      VER=$(grep 'appVersion:' $f | cut -d: -f 2 | xargs echo -n)
    44      [[ "$VERSION" != "$VER" ]] && { echo "FAILED: $f has incorrect appVersion"; PASS=false; }
    45  done
    46  
    47  [[ "$PASS" == "true" ]] && { echo "All version checks passed"; exit 0; } || exit 1;