JimMoen 2 лет назад
Родитель
Сommit
57505cdfb3

+ 1 - 1
.ci/docker-compose-file/docker-compose.yaml

@@ -24,7 +24,7 @@ services:
       - /tmp/emqx-ci/emqx-shared-secret:/var/lib/secret
       - ./kerberos/krb5.conf:/etc/kdc/krb5.conf
       - ./kerberos/krb5.conf:/etc/krb5.conf
-      - ./odbc/odbcinst.ini:/etc/odbcinst.ini
+      # - ./odbc/odbcinst.ini:/etc/odbcinst.ini
     working_dir: /emqx
     tty: true
     user: "${DOCKER_USER:-root}"

+ 0 - 1
.ci/docker-compose-file/odbc/odbcinst.ini

@@ -7,4 +7,3 @@ UsageCount=1
 Description=Microsoft ODBC Driver 17 for SQL Server
 Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.2.1
 UsageCount=1
-

+ 9 - 2
scripts/install-odbc-driver.sh

@@ -1,14 +1,21 @@
 #!/usr/bin/env bash
 
 ## this script install msodbcsql17 and unixodbc-dev on ci environment
+## specific to ubuntu 16.04, 18.04, 20.04, 22.04
 set -euo pipefail
 
 # install msodbcsql17
+if ! [[ "16.04 18.04 20.04 22.04" == *"$(lsb_release -rs)"* ]];
+then
+    echo "Ubuntu $(lsb_release -rs) is not currently supported.";
+    exit 1;
+fi
+
 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/ubuntu/$(lsb_release -rs)/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 mssql-tools && \
 ## and not needed to modify /etc/odbcinst.ini
 ## docker-compose will mount one in .ci/docker-compose-file/odbc
 sed -i 's/ODBC Driver 17 for SQL Server/ms-sql/g' /etc/odbcinst.ini