-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from arBmind/feature/redmine5
Redmine 5.0 support
- Loading branch information
Showing
46 changed files
with
642 additions
and
1,303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ARG RUBY_VERSION=3.1 | ||
ARG REDMINE_VERSION=5-stable | ||
|
||
FROM alpinelab/ruby-dev:${RUBY_VERSION} AS redmine | ||
ARG REDMINE_VERSION | ||
ENV REDMINE_VERSION=${REDMINE_VERSION} | ||
|
||
RUN \ | ||
cd / \ | ||
&& mv /app /redmine \ | ||
&& chmod ugo+w /redmine | ||
WORKDIR /redmine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
group :development do | ||
# gem 'better_errors' | ||
# gem 'binding_of_caller' | ||
# gem 'meta_request' # support RailsPanel in Chrome | ||
# | ||
# gem 'pry' | ||
# gem 'pry-byebug' | ||
# gem 'pry-rails' | ||
|
||
# gem "debase", "0.2.5.beta2", require: false | ||
# gem "ruby-debug-ide", "~> 0.7.3" | ||
gem "debug" | ||
gem 'rufo', require: false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
development: &postgres | ||
adapter: postgresql | ||
encoding: utf8 | ||
database: redmine | ||
username: postgres | ||
password: postgres | ||
host: postgres | ||
port: 5432 | ||
|
||
test: | ||
<<: *postgres | ||
database: redmine_test | ||
|
||
production: | ||
<<: *postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"name": "Redmine - Postgres", | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "redmine", | ||
"workspaceFolder": "/redmine", | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"username": "vscode", | ||
"userUid": "1000", | ||
"userGid": "1000" | ||
}, | ||
"ghcr.io/devcontainers/features/ruby:1": "none", | ||
"ghcr.io/devcontainers/features/node:1": "none", | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "latest", | ||
"ppa": "false" | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"rebornix.Ruby", | ||
"mtxr.sqltools", | ||
"mtxr.sqltools-driver-pg", | ||
"craigmaslowski.erb", | ||
"hridoy.rails-snippets", | ||
"misogi.ruby-rubocop", | ||
"jnbt.vscode-rufo", | ||
"donjayamanne.git-extension-pack" | ||
], | ||
"settings": { | ||
"sqltools.connections": [ | ||
{ | ||
"name": "Rails Development Database", | ||
"driver": "PostgreSQL", | ||
"previewLimit": 50, | ||
"server": "localhost", | ||
"port": 5432, | ||
"database": "redmine", | ||
"username": "postgres" | ||
}, | ||
{ | ||
"name": "Rails Test Database", | ||
"driver": "PostgreSQL", | ||
"previewLimit": 50, | ||
"server": "localhost", | ||
"port": 5432, | ||
"database": "redmine_test", | ||
"username": "postgres" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"forwardPorts": [ 5000 ], | ||
"postCreateCommand": "sh -x /redmine/post-create.sh", | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: '3.7' | ||
|
||
services: | ||
redmine: | ||
build: | ||
context: . | ||
target: redmine | ||
args: | ||
RUBY_VERSION: "3.1.3" | ||
REDMINE_VERSION: "5.0-stable" | ||
NODE_VERSION: "lts/*" | ||
volumes: | ||
- redmine-data:/redmine/files | ||
- node_modules:/redmine/node_modules | ||
- bundle:/bundle | ||
- ../..:/redmine/plugins/redmine_hourglass | ||
- ./Gemfile.local:/redmine/Gemfile.local | ||
- ./database.yml:/redmine/config/database.yml | ||
- ./post-create.sh:/redmine/post-create.sh | ||
environment: | ||
RAILS_ENV: development | ||
REDMINE_SECRET_KEY_BASE: supersecretkey | ||
REDMINE_PLUGINS_MIGRATE: 'true' | ||
command: sleep infinity | ||
depends_on: | ||
- postgres | ||
|
||
postgres: | ||
image: postgres:latest | ||
restart: unless-stopped | ||
volumes: | ||
- postgres-data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_DB: redmine | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
|
||
volumes: | ||
postgres-data: null | ||
redmine-data: | ||
node_modules: | ||
bundle: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
. ${NVM_DIR}/nvm.sh | ||
nvm install --lts | ||
|
||
sudo chown -R vscode:vscode . | ||
sudo chmod ugo+w /bundle | ||
|
||
git config --global --add safe.directory /redmine | ||
git init | ||
git remote add origin https://github.com/redmine/redmine.git | ||
git fetch | ||
git checkout -t origin/${REDMINE_VERSION} -f | ||
git apply plugins/redmine_hourglass/.devcontainer/postgres/redmine5_i18n.patch | ||
|
||
bundle | ||
|
||
bundle exec rails config/initializers/secret_token.rb | ||
bundle exec rails db:create | ||
bundle exec rails db:migrate | ||
bundle exec rails redmine:plugins | ||
|
||
# RAILS_ENV=test bundle exec rails db:drop | ||
# RAILS_ENV=test bundle exec rails db:create | ||
# RAILS_ENV=test bundle exec rails db:migrate | ||
# RAILS_ENV=test bundle exec rails redmine:plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/lib/redmine/i18n.rb b/lib/redmine/i18n.rb | ||
index 805e3c61c..42b5ab23f 100644 | ||
--- a/lib/redmine/i18n.rb | ||
+++ b/lib/redmine/i18n.rb | ||
@@ -125,7 +125,7 @@ module Redmine | ||
if options[:cache] == false | ||
available_locales = ::I18n.backend.available_locales | ||
valid_languages. | ||
- select {|locale| available_locales.include?(locale)}. | ||
+ select {|locale| available_locales.include?(locale) && (ll(locale.to_s, :general_lang_name) rescue false) }. | ||
map {|lang| [ll(lang.to_s, :general_lang_name), lang.to_s]}. | ||
sort_by(&:first) | ||
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.