Skip to content

Commit

Permalink
fix(release): refuse to run if the snapshot version is not updated
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Barbáchano <pablob@amazon.com>
  • Loading branch information
pb8o authored and andreitraistaru committed May 2, 2023
1 parent 259cd1f commit c7f20f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/release-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
set -eu -o pipefail
set -x

function check_snapshot_version {
local version=$1
local snap_version=$(echo $version |cut -f-2 -d. |tr . _)
if ! grep FC_V${snap_version}_SNAP_VERSION src/vmm/src/version_map.rs; then
die "I couldn't find FC_V${snap_version}_SNAP_VERSION in src/vmm/src/version_map.rs"
fi
}

FC_TOOLS_DIR=$(dirname $(realpath $0))
source "$FC_TOOLS_DIR/functions"
FC_ROOT_DIR=$FC_TOOLS_DIR/..
Expand All @@ -29,6 +37,7 @@ version=$1
validate_version "$version"

check_local_branch_is_release_branch
check_snapshot_version "$version"

# Create GitHub PR link
ORIGIN_URL=$(git config --get remote.origin.url)
Expand Down

0 comments on commit c7f20f1

Please sign in to comment.