diff --git a/alert/cmd/alert/main.go b/alert/cmd/alert/main.go index d3874396b4d49b46be642aa4e742e36b6c9568ef..f934a11d42237546cd3bbd6f91b48d3af5997e0f 100644 --- a/alert/cmd/alert/main.go +++ b/alert/cmd/alert/main.go @@ -119,7 +119,7 @@ WantedBy=multi-user.target return nil } -const version = "TDengine alert v1.0.0" +const version = "TDengine alert v2.0.0.0" func main() { var ( diff --git a/alert/go.mod b/alert/go.mod index e0bd1d1941d8654e747194891f7693b4d79d2fbc..01c557d5646714869ad263a9c8fe2fa262fe9a43 100644 --- a/alert/go.mod +++ b/alert/go.mod @@ -5,7 +5,7 @@ go 1.14 require ( github.com/jmoiron/sqlx v1.2.0 github.com/mattn/go-sqlite3 v2.0.3+incompatible - github.com/taosdata/driver-go master + github.com/taosdata/driver-go v0.0.0-20200727182616-1a3b1941c206 go.uber.org/zap v1.14.1 google.golang.org/appengine v1.6.5 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c diff --git a/alert/release.sh b/alert/release.sh index 44b383a57e1bc0cd387cb2fefeb2d580f3b5e19e..3342b0e56781408e5f21cf7aebaff0b88f9af0c4 100755 --- a/alert/release.sh +++ b/alert/release.sh @@ -1,12 +1,13 @@ set -e -# releash.sh -c [arm | arm64 | x64 | x86] +# releash.sh -c [armv6l | arm64 | amd64 | 386] # -o [linux | darwin | windows] # set parameters by default value -cpuType=x64 # [arm | arm64 | x64 | x86] +cpuType=amd64 # [armv6l | arm64 | amd64 | 386] osType=linux # [linux | darwin | windows] +declare -A archMap=(["armv6l"]="arm" ["arm64"]="arm64" ["amd64"]="x64" ["386"]="x86") while getopts "h:c:o:" arg do case $arg in @@ -19,7 +20,7 @@ do osType=$(echo $OPTARG) ;; h) - echo "Usage: `basename $0` -c [arm | arm64 | x64 | x86] -o [linux | darwin | windows]" + echo "Usage: `basename $0` -c [armv6l | arm64 | amd64 | 386] -o [linux | darwin | windows]" exit 0 ;; ?) #unknown option @@ -35,6 +36,7 @@ scriptdir=$(dirname $(readlink -f $0)) cd ${scriptdir}/cmd/alert version=$(grep 'const version =' main.go | awk '{print $NF}') version=${version%\"} +version=${version:1} echo "cpuType=${cpuType}" echo "osType=${osType}" @@ -42,4 +44,4 @@ echo "version=${version}" GOOS=${osType} GOARCH=${cpuType} go build -GZIP=-9 tar -zcf ${startdir}/tdengine-alert-${version}-${osType}-${cpuType}.tar.gz alert alert.cfg install_driver.sh driver/ +tar -I 'gzip -9' -cf ${startdir}/TDengine-alert-${version}-${osType^}-${archMap[${cpuType}]}.tar.gz alert alert.cfg install_driver.sh driver/