Deploy sh

This commit is contained in:
James Jeffrey
2017-06-09 13:42:59 -07:00
committed by Reed Allman
parent aa170c918f
commit 79f1dab007
10 changed files with 312 additions and 170 deletions

35
test.sh
View File

@@ -2,7 +2,37 @@
set -ex
docker rm -fv func-postgres-test || echo No prev test db container
docker run --name func-postgres-test -p 15432:5432 -d postgres
docker rm -fv func-mysql-test || echo No prev mysql test db container
docker run --name func-mysql-test -p 3307:3306 -e MYSQL_DATABASE=funcs -e MYSQL_ROOT_PASSWORD=root -d mysql
docker rm -fv func-redis-test|| echo No prev redis test db container
docker run --name func-redis-test -p 6301:6379 -d redis
sleep 5
if [ `uname` == "Darwin" ]
then
export POSTGRES_HOST=localhost
export POSTGRES_PORT=15432
export MYSQL_HOST=localhost
export MYSQL_PORT=3307
export REDIS_HOST=localhost
export REDIS_PORT=6301
else
export POSTGRES_HOST="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' func-postgres-test)"
export POSTGRES_PORT=5432
export MYSQL_HOST="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' func-mysql-test)"
export MYSQL_PORT=3306
export REDIS_HOST="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' func-redis-test)"
export REDIS_PORT=6379
fi
go test -v $(go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v fn)
# go test -v gitlab-odx.oracle.com/odx/functions/api/runner/drivers/docker
cd fn && make build && make test
# TODO: should we install fn here to use throughout?
export FN="$(pwd)/fn"
@@ -10,5 +40,6 @@ cd ..
# TODO: Test a bunch of the examples using fn test when ready
# checker tests env vars
cd examples/checker
./test.sh
# TODO: Fix checker tests behind proxy...
# cd examples/checker
# ./test.sh