style: make elvis and shellcheck happy

This commit is contained in:
JimMoen 2023-04-11 09:54:58 +08:00
parent 57505cdfb3
commit f8c0aa49a2
No known key found for this signature in database
GPG Key ID: 87A520B4F76BA86D
2 changed files with 8 additions and 5 deletions

View File

@ -342,9 +342,11 @@ do_get_status(Conn, RequestTimeout) ->
%% About the connection string attribute `Encrypt`: %% About the connection string attribute `Encrypt`:
%% The default value is `yes` in odbc version 18.0+ and `no` in previous versions. %% The default value is `yes` in odbc version 18.0+ and `no` in previous versions.
%% And encrypted connections always verify the server's certificate. %% And encrypted connections always verify the server's certificate.
%% So `Encrypt=YES;TrustServerCertificate=YES` must be set in the connection string when connecting to a server that has a self-signed certificate. %% So `Encrypt=YES;TrustServerCertificate=YES` must be set in the connection string
%% when connecting to a server that has a self-signed certificate.
%% See also: %% See also:
%% https://learn.microsoft.com/en-us/sql/connect/odbc/dsn-connection-string-attribute?source=recommendations&view=sql-server-ver16#encrypt %% 'https://learn.microsoft.com/en-us/sql/connect/odbc/
%% dsn-connection-string-attribute?source=recommendations&view=sql-server-ver16#encrypt'
conn_str([], Acc) -> conn_str([], Acc) ->
%% we should use this for msodbcsql 18+ %% we should use this for msodbcsql 18+
%% lists:join(";", ["Encrypt=YES", "TrustServerCertificate=YES" | Acc]); %% lists:join(";", ["Encrypt=YES", "TrustServerCertificate=YES" | Acc]);

View File

@ -5,14 +5,15 @@
set -euo pipefail set -euo pipefail
# install msodbcsql17 # install msodbcsql17
if ! [[ "16.04 18.04 20.04 22.04" == *"$(lsb_release -rs)"* ]]; VERSION=$(lsb_release -rs)
if ! [[ "16.04 18.04 20.04 22.04" == *"$VERSION"* ]];
then then
echo "Ubuntu $(lsb_release -rs) is not currently supported."; echo "Ubuntu $VERSION is not currently supported.";
exit 1; exit 1;
fi fi
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/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ curl https://packages.microsoft.com/config/ubuntu/"$VERSION"/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
## TODO: upgrade builder image ## TODO: upgrade builder image
apt-get update && \ apt-get update && \
ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev mssql-tools && \ ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev mssql-tools && \