Skip to content

Add Microsoft SQL server adapter #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ RUN buildDeps=' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& bundle install --without development test \
&& for adapter in mysql2 postgresql sqlite3; do \
&& for adapter in mysql2 postgresql sqlserver sqlite3; do \
echo "$RAILS_ENV:" > ./config/database.yml; \
echo " adapter: $adapter" >> ./config/database.yml; \
bundle install --without development test; \
Expand Down
11 changes: 10 additions & 1 deletion 3.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ case "$1" in
if [ ! -f './config/database.yml' ]; then
file_env 'REDMINE_DB_MYSQL'
file_env 'REDMINE_DB_POSTGRES'
file_env 'REDMINE_DB_SQLSERVER'

if [ "$MYSQL_PORT_3306_TCP" ] && [ -z "$REDMINE_DB_MYSQL" ]; then
export REDMINE_DB_MYSQL='mysql'
Expand All @@ -51,9 +52,17 @@ case "$1" in
file_env 'REDMINE_DB_PASSWORD' "${POSTGRES_ENV_POSTGRES_PASSWORD}"
file_env 'REDMINE_DB_DATABASE' "${POSTGRES_ENV_POSTGRES_DB:-${REDMINE_DB_USERNAME:-}}"
file_env 'REDMINE_DB_ENCODING' 'utf8'
elif [ "$REDMINE_DB_SQLSERVER" ]; then
adapter='sqlserver'
host="$REDMINE_DB_SQLSERVER"
file_env 'REDMINE_DB_PORT' '1433'
file_env 'REDMINE_DB_USERNAME' ''
file_env 'REDMINE_DB_PASSWORD' ''
file_env 'REDMINE_DB_DATABASE' ''
file_env 'REDMINE_DB_ENCODING' ''
else
echo >&2
echo >&2 'warning: missing REDMINE_DB_MYSQL or REDMINE_DB_POSTGRES environment variables'
echo >&2 'warning: missing REDMINE_DB_MYSQL, REDMINE_DB_POSTGRES, or REDMINE_DB_SQLSERVER environment variables'
echo >&2
echo >&2 '*** Using sqlite3 as fallback. ***'
echo >&2
Expand Down
2 changes: 1 addition & 1 deletion 3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ RUN buildDeps=' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& bundle install --without development test \
&& for adapter in mysql2 postgresql sqlite3; do \
&& for adapter in mysql2 postgresql sqlserver sqlite3; do \
echo "$RAILS_ENV:" > ./config/database.yml; \
echo " adapter: $adapter" >> ./config/database.yml; \
bundle install --without development test; \
Expand Down
11 changes: 10 additions & 1 deletion 3.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ case "$1" in
if [ ! -f './config/database.yml' ]; then
file_env 'REDMINE_DB_MYSQL'
file_env 'REDMINE_DB_POSTGRES'
file_env 'REDMINE_DB_SQLSERVER'

if [ "$MYSQL_PORT_3306_TCP" ] && [ -z "$REDMINE_DB_MYSQL" ]; then
export REDMINE_DB_MYSQL='mysql'
Expand All @@ -51,9 +52,17 @@ case "$1" in
file_env 'REDMINE_DB_PASSWORD' "${POSTGRES_ENV_POSTGRES_PASSWORD}"
file_env 'REDMINE_DB_DATABASE' "${POSTGRES_ENV_POSTGRES_DB:-${REDMINE_DB_USERNAME:-}}"
file_env 'REDMINE_DB_ENCODING' 'utf8'
elif [ "$REDMINE_DB_SQLSERVER" ]; then
adapter='sqlserver'
host="$REDMINE_DB_SQLSERVER"
file_env 'REDMINE_DB_PORT' '1433'
file_env 'REDMINE_DB_USERNAME' ''
file_env 'REDMINE_DB_PASSWORD' ''
file_env 'REDMINE_DB_DATABASE' ''
file_env 'REDMINE_DB_ENCODING' ''
else
echo >&2
echo >&2 'warning: missing REDMINE_DB_MYSQL or REDMINE_DB_POSTGRES environment variables'
echo >&2 'warning: missing REDMINE_DB_MYSQL, REDMINE_DB_POSTGRES, or REDMINE_DB_SQLSERVER environment variables'
echo >&2
echo >&2 '*** Using sqlite3 as fallback. ***'
echo >&2
Expand Down
2 changes: 1 addition & 1 deletion 3.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ RUN buildDeps=' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& bundle install --without development test \
&& for adapter in mysql2 postgresql sqlite3; do \
&& for adapter in mysql2 postgresql sqlserver sqlite3; do \
echo "$RAILS_ENV:" > ./config/database.yml; \
echo " adapter: $adapter" >> ./config/database.yml; \
bundle install --without development test; \
Expand Down
11 changes: 10 additions & 1 deletion 3.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ case "$1" in
if [ ! -f './config/database.yml' ]; then
file_env 'REDMINE_DB_MYSQL'
file_env 'REDMINE_DB_POSTGRES'
file_env 'REDMINE_DB_SQLSERVER'

if [ "$MYSQL_PORT_3306_TCP" ] && [ -z "$REDMINE_DB_MYSQL" ]; then
export REDMINE_DB_MYSQL='mysql'
Expand All @@ -51,9 +52,17 @@ case "$1" in
file_env 'REDMINE_DB_PASSWORD' "${POSTGRES_ENV_POSTGRES_PASSWORD}"
file_env 'REDMINE_DB_DATABASE' "${POSTGRES_ENV_POSTGRES_DB:-${REDMINE_DB_USERNAME:-}}"
file_env 'REDMINE_DB_ENCODING' 'utf8'
elif [ "$REDMINE_DB_SQLSERVER" ]; then
adapter='sqlserver'
host="$REDMINE_DB_SQLSERVER"
file_env 'REDMINE_DB_PORT' '1433'
file_env 'REDMINE_DB_USERNAME' ''
file_env 'REDMINE_DB_PASSWORD' ''
file_env 'REDMINE_DB_DATABASE' ''
file_env 'REDMINE_DB_ENCODING' ''
else
echo >&2
echo >&2 'warning: missing REDMINE_DB_MYSQL or REDMINE_DB_POSTGRES environment variables'
echo >&2 'warning: missing REDMINE_DB_MYSQL, REDMINE_DB_POSTGRES, or REDMINE_DB_SQLSERVER environment variables'
echo >&2
echo >&2 '*** Using sqlite3 as fallback. ***'
echo >&2
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ RUN buildDeps=' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& bundle install --without development test \
&& for adapter in mysql2 postgresql sqlite3; do \
&& for adapter in mysql2 postgresql sqlserver sqlite3; do \
echo "$RAILS_ENV:" > ./config/database.yml; \
echo " adapter: $adapter" >> ./config/database.yml; \
bundle install --without development test; \
Expand Down
11 changes: 10 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ case "$1" in
if [ ! -f './config/database.yml' ]; then
file_env 'REDMINE_DB_MYSQL'
file_env 'REDMINE_DB_POSTGRES'
file_env 'REDMINE_DB_SQLSERVER'

if [ "$MYSQL_PORT_3306_TCP" ] && [ -z "$REDMINE_DB_MYSQL" ]; then
export REDMINE_DB_MYSQL='mysql'
Expand All @@ -51,9 +52,17 @@ case "$1" in
file_env 'REDMINE_DB_PASSWORD' "${POSTGRES_ENV_POSTGRES_PASSWORD}"
file_env 'REDMINE_DB_DATABASE' "${POSTGRES_ENV_POSTGRES_DB:-${REDMINE_DB_USERNAME:-}}"
file_env 'REDMINE_DB_ENCODING' 'utf8'
elif [ "$REDMINE_DB_SQLSERVER" ]; then
adapter='sqlserver'
host="$REDMINE_DB_SQLSERVER"
file_env 'REDMINE_DB_PORT' '1433'
file_env 'REDMINE_DB_USERNAME' ''
file_env 'REDMINE_DB_PASSWORD' ''
file_env 'REDMINE_DB_DATABASE' ''
file_env 'REDMINE_DB_ENCODING' ''
else
echo >&2
echo >&2 'warning: missing REDMINE_DB_MYSQL or REDMINE_DB_POSTGRES environment variables'
echo >&2 'warning: missing REDMINE_DB_MYSQL, REDMINE_DB_POSTGRES, or REDMINE_DB_SQLSERVER environment variables'
echo >&2
echo >&2 '*** Using sqlite3 as fallback. ***'
echo >&2
Expand Down