dockerManifest.sh 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
#!/bin/bash
set -e
#set -x

# dockerbuild.sh 
#             -n [version number]
#             -p [xxxx]

# set parameters by default value
verNumber=""
passWord=""

while getopts "hn:p:" arg
do
  case $arg in
    n)
      #echo "verNumber=$OPTARG"
      verNumber=$(echo $OPTARG)
      ;;
    p)
      #echo "passWord=$OPTARG"
      passWord=$(echo $OPTARG)
      ;;
    h)
      echo "Usage: `basename $0` -n [version number] "
      echo "                      -p [password for docker hub] "
      exit 0
      ;;
    ?) #unknow option 
      echo "unkonw argument"
      exit 1
      ;;
  esac
done

echo "verNumber=${verNumber}"

B
bryanchang0603 已提交
38 39 40
#docker manifest rm tdengine/tdengine
#docker manifest rm tdengine/tdengine:${verNumber}
docker manifest create -a tdengine/tdengine:${verNumber} tdengine/tdengine-amd64:${verNumber} tdengine/tdengine-aarch64:${verNumber} tdengine/tdengine-aarch32:${verNumber}
41
docker manifest create -a tdengine/tdengine:latest tdengine/tdengine-amd64:latest tdengine/tdengine-aarch64:latest tdengine/tdengine-aarch32:latest
42 43 44

docker login -u tdengine -p ${passWord}  #replace the docker registry username and password

45
docker manifest push tdengine/tdengine:latest
46 47

# how set latest version ???