Você não pode selecionar mais de 25 tópicos
Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
|
- #!/bin/bash
- environment=$1
- version=$2
- echo "环境变量为${environment},版本为$version!"
- if [[ ${environment} == 'pro1' ]]; then
- #echo "开始远程构建容器"
- docker stop gd202101_service || true
- docker rm gd202101_service || true
- docker rmi -f $(docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}')
- docker pull 139.224.254.18:5000/gd202101_service:$version
- docker run -v /home/data/gd202101server/log:/var/log/gd202101server -e active=pro1 --restart=always -d --network host --name gd202101_service 139.224.254.18:5000/gd202101_service:$version
- #删除产生的None镜像
- docker rmi -f $(docker images | grep none | awk '{print $3}')
- docker ps -a
- fi
- if [[ ${environment} == 'pro2' ]]; then
- #echo "开始远程构建容器"
- docker stop gd202101_service || true
- docker rm gd202101_service || true
- docker rmi -f $(docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}')
- docker pull 139.224.254.18:5000/gd202101_service:$version
- docker run -v /home/data/gd202101server/log:/var/log/gd202101server -e active=pro2 --restart=always -d --network host --name gd202101_service 139.224.254.18:5000/gd202101_service:$version
- #删除产生的None镜像
- docker rmi -f $(docker images | grep none | awk '{print $3}')
- docker ps -a
- fi
- if [[ ${environment} == 'pro3' ]]; then
- #echo "开始远程构建容器"
- docker stop gd202101_service || true
- docker rm gd202101_service || true
- docker rmi -f $(docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}')
- docker pull 139.224.254.18:5000/gd202101_service:$version
- docker run -v /home/data/gd202101server/log:/var/log/gd202101server -e active=pro3 --restart=always -d --network host
- --name gd202101_service 139.224.254.18:5000/gd202101_service:$version
- #删除产生的None镜像
- docker rmi -f $(docker images | grep none | awk '{print $3}')
- docker ps -a
- fi
- if [[ ${environment} == 'test' ]]; then
- #echo "开始远程构建容器"
- docker stop gd202101_service || true
- docker rm gd202101_service || true
- docker rmi -f $(docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}')
- docker pull 139.224.254.18:5000/gd202101_service:$version
- docker run -v /home/data/gd202101server/log:/var/log/gd202101server -e active=test --restart=always -d --network host --name gd202101_service 139.224.254.18:5000/gd202101_service:$version
- #删除产生的None镜像
- docker rmi -f $(docker images | grep none | awk '{print $3}')
- docker ps -a
- fi
- if [[ ${environment} == 'dev' ]]; then
- docker stop gd202101_service || true
- docker rm gd202101_service || true
- docker rmi -f $(docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}')
- docker pull 139.224.254.18:5000/gd202101_service:$version
- docker run -v /home/data/gd202101server/log:/var/log/gd202101server -e active=dev --restart=always -d --network host --name gd202101_service telpo/gd202101_service:$version
- #删除产生的None镜像
- docker rmi -f $(docker images | grep none | awk '{print $3}')
- docker ps -a
- fi
|