Amqp Test
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

29 rindas
1.5KB

  1. #!/bin/bash
  2. environment=$1
  3. version=$2
  4. echo "环境变量为${environment},版本为$version!"
  5. if [[ ${environment} == 'production' ]]; then
  6. echo "开始远程构建容器"
  7. docker stop gps_gateway || true
  8. docker rm gps_gateway || true
  9. docker rmi -f $(docker images | grep registry.cn-shanghai.aliyuncs.com/gps_card/gps_gateway | awk '{print $3}')
  10. #docker login --username=telpo_linwl@1111649216405698 --password=telpo#1234 registry.cn-shanghai.aliyuncs.com
  11. docker login --username=telpo_fengjj@1111649216405698 --password=PWDaliyun123 registry.cn-shanghai.aliyuncs.com
  12. docker pull registry.cn-shanghai.aliyuncs.com/gps_card/gps_gateway:$version
  13. docker run -d -e environment=production -v /home/data/gps_gateway/log:/var/gateway/logs --restart=always --name gps_gateway registry.cn-shanghai.aliyuncs.com/gps_card/gps_gateway:$version;
  14. #删除产生的None镜像
  15. docker rmi -f $(docker images | grep none | awk '{print $3}')
  16. docker ps -a
  17. elif [[ ${environment} == 'test' ]]; then
  18. echo "开始在测试环境远程构建容器"
  19. docker stop gps_gateway || true
  20. docker rm gps_gateway || true
  21. docker rmi -f $(docker images | grep 139.224.254.18:5000/gps_gateway | awk '{print $3}')
  22. docker pull 139.224.254.18:5000/gps_gateway:$version
  23. docker run -d -e environment=test -v /home/data/gps_gateway/log:/var/gateway/logs --restart=always --name gps_gateway 139.224.254.18:5000/gps_gateway:$version;
  24. #删除产生的None镜像
  25. docker rmi -f $(docker images | grep none | awk '{print $3}')
  26. docker ps -a
  27. fi