电子围栏推送服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

telpo_push_fence_run.sh 1.5KB

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