mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Use localhost or docker host.
This commit is contained in:
26
test.sh
26
test.sh
@@ -10,14 +10,32 @@ docker rm -fv func-redis-test|| echo No prev redis test db container
|
|||||||
docker run --name func-redis-test -p 6301:6379 -d redis
|
docker run --name func-redis-test -p 6301:6379 -d redis
|
||||||
sleep 5
|
sleep 5
|
||||||
case ${DOCKER_LOCATION-localhost} in
|
case ${DOCKER_LOCATION-localhost} in
|
||||||
docker_ip)
|
localhost)
|
||||||
export POSTGRES_HOST=${DOCKER_HOST-localhost}
|
export POSTGRES_HOST=localhost
|
||||||
export POSTGRES_PORT=15432
|
export POSTGRES_PORT=15432
|
||||||
|
|
||||||
export MYSQL_HOST=${DOCKER_HOST-localhost}
|
export MYSQL_HOST=localhost
|
||||||
export MYSQL_PORT=3307
|
export MYSQL_PORT=3307
|
||||||
|
|
||||||
export REDIS_HOST=${DOCKER_HOST-localhost}
|
export REDIS_HOST=localhost
|
||||||
|
export REDIS_PORT=6301
|
||||||
|
;;
|
||||||
|
docker_ip)
|
||||||
|
if [[ ! -z ${DOCKER_HOST} ]]
|
||||||
|
then
|
||||||
|
DOCKER_IP=`echo ${DOCKER_HOST} | awk -F/ '{print $3}'`
|
||||||
|
if [[ -z ${DOCKER_IP} ]]
|
||||||
|
then
|
||||||
|
DOCKER_IP=localhost
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
export POSTGRES_HOST=${DOCKER_IP-localhost}
|
||||||
|
export POSTGRES_PORT=15432
|
||||||
|
|
||||||
|
export MYSQL_HOST=${DOCKER_IP-localhost}
|
||||||
|
export MYSQL_PORT=3307
|
||||||
|
|
||||||
|
export REDIS_HOST=${DOCKER_IP-localhost}
|
||||||
export REDIS_PORT=6301
|
export REDIS_PORT=6301
|
||||||
;;
|
;;
|
||||||
container_ip)
|
container_ip)
|
||||||
|
|||||||
Reference in New Issue
Block a user