ci: install odbc driver for ms sqlserver bridge
This commit is contained in:
parent
59433b8b33
commit
d7ad07f1dc
|
@ -39,6 +39,7 @@ ONLY_UP='no'
|
||||||
ATTACH='no'
|
ATTACH='no'
|
||||||
STOP='no'
|
STOP='no'
|
||||||
IS_CI='no'
|
IS_CI='no'
|
||||||
|
ODBC_REQUEST='no'
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-h|--help)
|
-h|--help)
|
||||||
|
@ -181,6 +182,7 @@ for dep in ${CT_DEPS}; do
|
||||||
FILES+=( '.ci/docker-compose-file/docker-compose-cassandra.yaml' )
|
FILES+=( '.ci/docker-compose-file/docker-compose-cassandra.yaml' )
|
||||||
;;
|
;;
|
||||||
sqlserver)
|
sqlserver)
|
||||||
|
ODBC_REQUEST='yes'
|
||||||
FILES+=( '.ci/docker-compose-file/docker-compose-sqlserver.yaml' )
|
FILES+=( '.ci/docker-compose-file/docker-compose-sqlserver.yaml' )
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -190,6 +192,12 @@ for dep in ${CT_DEPS}; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$ODBC_REQUEST" = 'yes' ]; then
|
||||||
|
INSTALL_ODBC="./scripts/install-odbc-driver.sh"
|
||||||
|
else
|
||||||
|
INSTALL_ODBC="echo 'Driver msodbcsql driver not requested'"
|
||||||
|
fi
|
||||||
|
|
||||||
F_OPTIONS=""
|
F_OPTIONS=""
|
||||||
|
|
||||||
for file in "${FILES[@]}"; do
|
for file in "${FILES[@]}"; do
|
||||||
|
@ -232,6 +240,7 @@ docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "openssl rand -base
|
||||||
# the user must exist inside the container for `whoami` to work
|
# the user must exist inside the container for `whoami` to work
|
||||||
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "useradd --uid $DOCKER_USER -M -d / emqx" || true
|
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "useradd --uid $DOCKER_USER -M -d / emqx" || true
|
||||||
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "chown -R $DOCKER_USER /var/lib/secret" || true
|
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "chown -R $DOCKER_USER /var/lib/secret" || true
|
||||||
|
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "$INSTALL_ODBC" || true
|
||||||
|
|
||||||
if [ "$ONLY_UP" = 'yes' ]; then
|
if [ "$ONLY_UP" = 'yes' ]; then
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -6,6 +6,8 @@ set -euo pipefail
|
||||||
# install msodbcsql17
|
# install msodbcsql17
|
||||||
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
|
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
|
||||||
curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
|
curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
|
||||||
|
## TODO: upgrade builder image
|
||||||
|
apt-get update && \
|
||||||
ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev && \
|
ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev && \
|
||||||
## and not needed to modify /etc/odbcinst.ini
|
## and not needed to modify /etc/odbcinst.ini
|
||||||
## docker-compose will mount one in .ci/docker-compose-file/odbc
|
## docker-compose will mount one in .ci/docker-compose-file/odbc
|
||||||
|
|
Loading…
Reference in New Issue