This is an automated email from the ASF dual-hosted git repository. tokers pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git
The following commit(s) were added to refs/heads/master by this push: new f0ed89f chore: add check version script (#200) f0ed89f is described below commit f0ed89f96976f68a8fd490f8ba686ffed52af71d Author: rootlh <302824...@qq.com> AuthorDate: Fri Jan 22 19:52:22 2021 +0800 chore: add check version script (#200) * add:check version script * add:check version script --- utils/check-version.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/utils/check-version.sh b/utils/check-version.sh new file mode 100755 index 0000000..6afc50b --- /dev/null +++ b/utils/check-version.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +ver=$1 + +red='\e[0;41m' +RED='\e[1;31m' +green='\e[0;32m' +GREEN='\e[1;32m' +NC='\e[0m' + +# Makefile $ver +matched=`grep "VERSION ?= [0-9][0-9.]*" -r Makefile` +expected=`grep "VERSION ?= $ver" -r Makefile` + +if [ "$matched" = "$expected" ]; then + echo -e "${green}passed: version $ver ${NC}" +else + echo -e "${RED}failed: version $ver ${NC}" 1>&2 + echo + echo "-----maybe wrong version-----" + echo "$matched" + exit 1 +fi