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.

20 rindas
715B

  1. #!/bin/bash
  2. environment=$1
  3. version=$2
  4. echo "环境变量为${environment},版本为$version!"
  5. if [[ ${environment} == 'production' ]]; then
  6. echo "开始远程构建容器"
  7. exit 0
  8. elif [[ ${environment} == 'test' ]]; then
  9. echo "开始在测试环境远程构建容器"
  10. docker stop amqp_test || true
  11. docker rm amqp_test || true
  12. docker rmi -f $(docker images | grep 139.224.254.18:5000/amqp_test | awk '{print $3}')
  13. docker pull 139.224.254.18:5000/amqp_test:$version
  14. docker run -d -e environment=test -v /home/data/amqp_test/log:/var/amqp/logs --name amqp_test 139.224.254.18:5000/amqp_test:$version;
  15. #删除产生的None镜像
  16. docker rmi -f $(docker images | grep none | awk '{print $3}')
  17. docker ps -a
  18. fi