北斗定位
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.

31 rinda
1.6KB

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