transfer_yl/sh/depoly.sh

17 lines
426 B
Bash
Raw Normal View History

2024-11-04 14:05:53 +08:00
#!/bin/bash
. $(pwd)/sh/config.sh
ENV=$(cat "$(pwd)/env")
# 使用if-elif-else结构判断环境
if [ "$ENV"=="produce" ]; then
ADDRESS="${PRODUCE_ADDRESS}"
elif [ "$ENV"=="test" ]; then
ADDRESS="${TEST_ADDRESS}"
else
ADDRESS="${PRODUCE_ADDRESS}"
fi
echo docker pull ${ADDRESS}:${VERSION}
echo rm -f "${CONTAINER}"
echo docker run -it -p "${PORT}:${PORT}" --net transfer --name "${CONTAINER}" "${ADDRESS}:${VERSION}"