mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-26 06:43:56 +03:00
Added support for mssql on dev env
This commit is contained in:
parent
1d4bea68af
commit
bb9e57fa8b
5 changed files with 48 additions and 7 deletions
|
@ -115,7 +115,8 @@
|
||||||
"@test:db:sqlite",
|
"@test:db:sqlite",
|
||||||
"@test:db:mysql",
|
"@test:db:mysql",
|
||||||
"@test:db:maria",
|
"@test:db:maria",
|
||||||
"@test:db:postgres"
|
"@test:db:postgres",
|
||||||
|
"@test:db:ms"
|
||||||
],
|
],
|
||||||
"test:db:ci": [
|
"test:db:ci": [
|
||||||
"@test:db:sqlite",
|
"@test:db:sqlite",
|
||||||
|
@ -126,6 +127,7 @@
|
||||||
"test:db:mysql": "DB_DRIVER=mysql composer test:db:sqlite",
|
"test:db:mysql": "DB_DRIVER=mysql composer test:db:sqlite",
|
||||||
"test:db:maria": "DB_DRIVER=maria composer test:db:sqlite",
|
"test:db:maria": "DB_DRIVER=maria composer test:db:sqlite",
|
||||||
"test:db:postgres": "DB_DRIVER=postgres composer test:db:sqlite",
|
"test:db:postgres": "DB_DRIVER=postgres composer test:db:sqlite",
|
||||||
|
"test:db:ms": "DB_DRIVER=mssql composer test:db:sqlite",
|
||||||
"test:api": "bin/test/run-api-tests.sh",
|
"test:api": "bin/test/run-api-tests.sh",
|
||||||
"test:unit:pretty": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-html build/coverage",
|
"test:unit:pretty": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-html build/coverage",
|
||||||
"infect": "infection --threads=4 --min-msi=80 --log-verbosity=default --only-covered",
|
"infect": "infection --threads=4 --min-msi=80 --log-verbosity=default --only-covered",
|
||||||
|
|
|
@ -45,6 +45,13 @@ $buildDbConnection = function (): array {
|
||||||
'dbname' => 'shlink_test',
|
'dbname' => 'shlink_test',
|
||||||
'charset' => 'utf8',
|
'charset' => 'utf8',
|
||||||
],
|
],
|
||||||
|
'mssql' => [
|
||||||
|
'driver' => 'pdo_sqlsrv',
|
||||||
|
'host' => $isCi ? '127.0.0.1' : 'shlink_db_ms',
|
||||||
|
'user' => 'sa',
|
||||||
|
'password' => $isCi ? '' : 'Passw0rd!',
|
||||||
|
'dbname' => 'shlink_test',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
$driverConfigMap['maria'] = $driverConfigMap['mysql'];
|
$driverConfigMap['maria'] = $driverConfigMap['mysql'];
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,18 @@ RUN docker-php-ext-configure xdebug\
|
||||||
# cleanup
|
# cleanup
|
||||||
RUN rm /tmp/xdebug.tar.gz
|
RUN rm /tmp/xdebug.tar.gz
|
||||||
|
|
||||||
|
# Install sqlsrv driver
|
||||||
|
RUN wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.1.1-1_amd64.apk && \
|
||||||
|
wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.5.1.1-1_amd64.apk && \
|
||||||
|
apk add --allow-untrusted msodbcsql17_17.5.1.1-1_amd64.apk && \
|
||||||
|
apk add --allow-untrusted mssql-tools_17.5.1.1-1_amd64.apk && \
|
||||||
|
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
|
||||||
|
pecl install pdo_sqlsrv && \
|
||||||
|
docker-php-ext-enable pdo_sqlsrv && \
|
||||||
|
apk del .phpize-deps && \
|
||||||
|
rm msodbcsql17_17.5.1.1-1_amd64.apk && \
|
||||||
|
rm mssql-tools_17.5.1.1-1_amd64.apk
|
||||||
|
|
||||||
# Install composer
|
# Install composer
|
||||||
RUN php -r "readfile('https://getcomposer.org/installer');" | php
|
RUN php -r "readfile('https://getcomposer.org/installer');" | php
|
||||||
RUN chmod +x composer.phar
|
RUN chmod +x composer.phar
|
||||||
|
|
|
@ -66,12 +66,17 @@ RUN docker-php-ext-configure inotify\
|
||||||
# cleanup
|
# cleanup
|
||||||
RUN rm /tmp/inotify.tar.gz
|
RUN rm /tmp/inotify.tar.gz
|
||||||
|
|
||||||
# Install swoole
|
# Install swoole and mssql driver
|
||||||
# First line fixes an error when installing pecl extensions. Found in https://github.com/docker-library/php/issues/233
|
RUN wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.1.1-1_amd64.apk && \
|
||||||
RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS && \
|
wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.5.1.1-1_amd64.apk && \
|
||||||
pecl install swoole-${SWOOLE_VERSION} && \
|
apk add --allow-untrusted msodbcsql17_17.5.1.1-1_amd64.apk && \
|
||||||
docker-php-ext-enable swoole && \
|
apk add --allow-untrusted mssql-tools_17.5.1.1-1_amd64.apk && \
|
||||||
apk del .phpize-deps
|
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
|
||||||
|
pecl install swoole-${SWOOLE_VERSION} pdo_sqlsrv && \
|
||||||
|
docker-php-ext-enable swoole pdo_sqlsrv && \
|
||||||
|
apk del .phpize-deps && \
|
||||||
|
rm msodbcsql17_17.5.1.1-1_amd64.apk && \
|
||||||
|
rm mssql-tools_17.5.1.1-1_amd64.apk
|
||||||
|
|
||||||
# Install composer
|
# Install composer
|
||||||
RUN php -r "readfile('https://getcomposer.org/installer');" | php
|
RUN php -r "readfile('https://getcomposer.org/installer');" | php
|
||||||
|
|
|
@ -25,6 +25,7 @@ services:
|
||||||
- shlink_db
|
- shlink_db
|
||||||
- shlink_db_postgres
|
- shlink_db_postgres
|
||||||
- shlink_db_maria
|
- shlink_db_maria
|
||||||
|
- shlink_db_ms
|
||||||
- shlink_redis
|
- shlink_redis
|
||||||
|
|
||||||
shlink_swoole:
|
shlink_swoole:
|
||||||
|
@ -42,7 +43,12 @@ services:
|
||||||
- shlink_db
|
- shlink_db
|
||||||
- shlink_db_postgres
|
- shlink_db_postgres
|
||||||
- shlink_db_maria
|
- shlink_db_maria
|
||||||
|
- shlink_db_ms
|
||||||
- shlink_redis
|
- shlink_redis
|
||||||
|
environment:
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
LANGUAGE: en_US.UTF-8
|
||||||
|
LC_ALL: C
|
||||||
|
|
||||||
shlink_db:
|
shlink_db:
|
||||||
container_name: shlink_db
|
container_name: shlink_db
|
||||||
|
@ -82,6 +88,15 @@ services:
|
||||||
MYSQL_DATABASE: shlink
|
MYSQL_DATABASE: shlink
|
||||||
MYSQL_INITDB_SKIP_TZINFO: 1
|
MYSQL_INITDB_SKIP_TZINFO: 1
|
||||||
|
|
||||||
|
shlink_db_ms:
|
||||||
|
container_name: shlink_db_ms
|
||||||
|
image: mcr.microsoft.com/mssql/server:2019-latest
|
||||||
|
ports:
|
||||||
|
- "1433:1433"
|
||||||
|
environment:
|
||||||
|
ACCEPT_EULA: Y
|
||||||
|
SA_PASSWORD: "Passw0rd!"
|
||||||
|
|
||||||
shlink_redis:
|
shlink_redis:
|
||||||
container_name: shlink_redis
|
container_name: shlink_redis
|
||||||
image: redis:5.0-alpine
|
image: redis:5.0-alpine
|
||||||
|
|
Loading…
Reference in a new issue