github.com/verrazzano/verrazzano@v1.7.0/release/scripts/prerelease_validation.sh (about) 1 #!/usr/bin/env bash 2 # 3 # Copyright (c) 2021, 2022, 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 # Run prerelease validation checks 8 9 usage() { 10 cat <<EOM 11 Performs pre-release validation checks. 12 13 Usage: 14 $(basename $0) <version to release> 15 16 Example: 17 $(basename $0) 1.0.2 18 19 This script depends on git and verrazzano-helper and 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 SCRIPT_DIR=$(dirname "$0") 28 29 # Check for CRD changes 30 31 echo "Checking for CRD changes... you should visually inspect for potential backward incompatibilities" 32 $SCRIPT_DIR/compare_crds.sh $VERSION 33 EXIT_CODE=$? 34 echo "" 35 36 # Check .verrazzano-development-version and Chart.yaml versions 37 38 echo "Checking versions..." 39 $SCRIPT_DIR/check_versions.sh $VERSION 40 ((EXIT_CODE |= $?)) 41 echo "" 42 43 # If this is a patch release, check for any tickets that don't have backported commits 44 45 if [[ "$VERSION" == *.0 ]]; then 46 echo "Not a patch release, skipping backported commits check" 47 else 48 if ! command -v ${WORKSPACE}/verrazzano-helper &> /dev/null 49 then 50 echo "verrazzano-helper must be in the top level of the workspace" 51 EXIT_CODE=1 52 fi 53 54 echo "Checking for missing backport commits..." 55 ${WORKSPACE}/verrazzano-helper get ticket-backports $VERSION --ticket-env prod --token unused 56 ((EXIT_CODE |= $?)) 57 fi 58 59 # If the IGNORE_FAILURES environment variable is set, always exit with zero 60 echo "IGNORE_FAILURES=${IGNORE_FAILURES}" 61 62 [[ "$IGNORE_FAILURES" == "true" ]] && exit 0 || exit $EXIT_CODE