Skip to content

Commit af60b38

Browse files
authored
Merge pull request slick#2057 from WellingR/feature/db2-docker
Use new db2 image as the old one is no longer available
2 parents b8746ed + cdcbf47 commit af60b38

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

travis/runcontainer.sh

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ do
2929
shift
3030
done
3131

32-
# This bit is properly weird and took me ages to find a workaround. Basically, without a connection
33-
# to the db in a shell that is kept alive, aggregate functions with nulls behave incorrectly
34-
# so the AggregateTest.testGroupBy test fails
35-
db2HackConnection () {
36-
echo "Starting persistent db2 connection"
37-
docker exec -i ${CONTAINER_NAME} bash -c "su - db2inst1 -c 'while true; do db2 connect to $DB2NAME && while sleep 65535;do :; done; sleep 5; done'" &
38-
}
39-
4032
# sometimes, startup on travis fails, so retry up to 5 times.
4133
for try in 1 2 3 4 5
4234
do
@@ -50,10 +42,9 @@ do
5042
elif [ "${CONTAINER_NAME}" = "mssqlslicktest" ]; then
5143
RESULT=$(docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=Freeslick18' -p 1401:1433 --name mssqlslicktest -d microsoft/mssql-server-linux:2017-latest && echo -e "\n${SUCCESS_TOKEN}")
5244
elif [ "${CONTAINER_NAME}" = "db2slick" ]; then
53-
RESULT=$(docker run -d -p 50000:50000 --name ${CONTAINER_NAME} -e DB2INST1_PASSWORD=db2inst1-pwd -e LICENSE=accept ibmcom/db2express-c:latest "db2start" &&
45+
RESULT=$(docker run -d -p 50000:50000 --name ${CONTAINER_NAME} -e DB2INST1_PASSWORD=db2inst1-pwd -e DB2INSTANCE=db2inst1 -e DBNAME=${DB2NAME} -e LICENSE=accept --privileged=true ibmcom/db2:latest &&
5446
# Extract non-free db2 jdbc driver jar
55-
docker cp ${CONTAINER_NAME}:/home/db2inst1/sqllib/java/db2jcc4.jar . &&
56-
docker exec -i -u db2inst1 -t ${CONTAINER_NAME} bash -l -c "db2 create database $DB2NAME" &&
47+
docker cp ${CONTAINER_NAME}:/opt/ibm/db2/V11.5/java/db2jcc4.jar . &&
5748
echo -e "\n${SUCCESS_TOKEN}")
5849
fi
5950
elif [ "$RUNNING" = "false" ]; then
@@ -67,8 +58,6 @@ do
6758
if [ "${LAST_LINE}" != "${SUCCESS_TOKEN}" ]; then
6859
echo "Container startup failed. Retry ..."
6960
break
70-
elif [ "${CONTAINER_NAME}" = "db2slick" ]; then
71-
db2HackConnection
7261
fi
7362
done
7463
if [ "${LAST_LINE}" = "${SUCCESS_TOKEN}" ]; then

0 commit comments

Comments
 (0)