blob: 53bba3d86f8264e8273029c0e7042d1bb29c36cb [file] [log] [blame]
Joey Armstrong695ba5c2023-01-20 11:17:49 -05001# Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
Matteo Scandoloc209e802021-06-07 16:59:30 +02002
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6
7# http://www.apache.org/licenses/LICENSE-2.0
8
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15CWD=$( dirname ${BASH_SOURCE[0]} )
16NEW_VERSION=$(head -n1 "$CWD/../VERSION")
17
18if [[ "$NEW_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]
19then
20 echo "Version string '$NEW_VERSION' is a SemVer released version!"
21 SNAPSHOTS=$(cat "$CWD/../dependencies.xml" | grep "SNAPSHOT" | wc -l)
22 if [[ "$SNAPSHOTS" -gt 0 ]]
23 then
24 echo "ERROR: Referring to -SNAPSHOT apps in a released VERSION"
25 exit 1
26 fi
27fi