blob: 65ad4d611bbb6afe51152a20979b67f44d197ca4 [file] [log] [blame]
Matteo Scandoloc209e802021-06-07 16:59:30 +02001# Copyright 2021-present Open Networking Foundation
2
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