Joey Armstrong | 695ba5c | 2023-01-20 11:17:49 -0500 | [diff] [blame] | 1 | # Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors |
Matteo Scandolo | c209e80 | 2021-06-07 16:59:30 +0200 | [diff] [blame] | 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 | |
| 15 | CWD=$( dirname ${BASH_SOURCE[0]} ) |
| 16 | NEW_VERSION=$(head -n1 "$CWD/../VERSION") |
| 17 | |
| 18 | if [[ "$NEW_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]] |
| 19 | then |
| 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 |
| 27 | fi |