seninel部署
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

32 lignes
1.5KB

  1. #!/bin/bash
  2. environment=$1
  3. version=$2
  4. echo "环境变量为${environment},版本为$version!"
  5. if [[ ${environment} == 'pro' ]]; then
  6. echo "开始远程构建容器"
  7. docker stop sentinel_dashboard || true
  8. docker rm sentinel_dashboard || true
  9. docker rmi -f $(docker images | grep registry.cn-shanghai.aliyuncs.com/telpo_platform/sentinel_dashboard | 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/sentinel_dashboard:$version
  12. docker run -e active=pro -p 7777:7777 -v /home/data/sentineldashboard/log:/var/log/sentineldashboard --restart=always -d --name sentinel_dashboard registry.cn-shanghai.aliyuncs.com/telpo_platform/sentinel_dashboard:$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 sentinel_dashboard || true
  20. docker rm sentinel_dashboard || true
  21. docker rmi -f $(docker images | grep 139.224.254.18:5000/sentinel_dashboard | awk '{print $3}')
  22. docker pull 139.224.254.18:5000/sentinel_dashboard:$version
  23. docker run -p 7777:7777 -v /home/data/sentineldashboard/log:/var/log/sentineldashboard -e active=test --restart=always -d --network host --name sentinel_dashboard 139.224.254.18:5000/sentinel_dashboard:$version
  24. #删除产生的None镜像
  25. docker rmi -f $(docker images | grep none | awk '{print $3}')
  26. docker ps -a
  27. fi
  28. fi