退役SEのつれづれ日記

定年退役SEが、つれづれなる想いをしたためています。
(旧名:『システムノヲニワソト』)

[redmine]redmine5.1のPlugin機能検証(その2):additionals/additional_tags

2024-05-26 | サーバ設定(redmine,zabbix
『Redmineにて欲するTag機能なるプラグインを導入する』の件。
(環境の前提は、Windows11Pro+WSL2+ubuntu24.04+bitnami社のdocker redmine containerの使用)
ーーー
以前、Redmine4.1.0で導入していた「redmine_tagging」プラグインは、その後、苦戦続きで
導入できず、利用をあきらめていた状況。
(参考)
1.[#redmine4.1][#plugin]redmine4.1でpluginの稼働検証する(その8)
https://blog.goo.ne.jp/system-oni800/e/f63a4519516d1ce34d423c6d12060732

最近、知り合いの会社で、タグ機能のプラグインとして「redmine_tags」を使用していたが、
バージョン5に上げるタイミングでAdditional_tagspプラグインに切り替えたとのことを聞きつけ、そうそうにテスト。
(参考)
2.Addtional_tagsプラグイン
https://github.com/alphanodes/additional_tags

2つのプラグイン、
・addtionalsプラグイン
・additional_tagsプラグイン
の導入が必要とのこと。
Redmineコンテナに引き継ぐディレクトリに2つのプラグインを設置してdocker composeコマンドで起動するも
数秒でコンテナが停止してしまう状態に。
user@hogehoge:~/redmine# docker compose up -d
[+] Building 0.0s (0/0)                                                                                  docker:default
[+] Running 3/3
 ✔ Network redmine_default      Created                                                                            0.1s
 ✔ Container redmine-mariadb-1  Started                                                                            0.1s
 ✔ Container redmine-redmine-1  Started                                                                            0.1s
user@hogehoge:~/redmine# docker compose ps -a
NAME                IMAGE                             COMMAND                  SERVICE   CREATED         STATUS
PORTS
redmine-mariadb-1   docker.io/bitnami/mariadb:11.1    "/opt/bitnami/script…"   mariadb   6 seconds ago   Up 4 seconds   3306/tcp
redmine-redmine-1   docker.io/bitnami/redmine:5.1.2   "/opt/bitnami/script…"   redmine   5 seconds ago   Up 4 seconds   0.0.0.0:80->3000/tcp, :::80->3000/tcp
user@hogehoge:~/redmine# docker compose ps -a
NAME                IMAGE                             COMMAND                  SERVICE   CREATED          STATUS                     PORTS
redmine-mariadb-1   docker.io/bitnami/mariadb:11.1    "/opt/bitnami/script…"   mariadb   10 seconds ago   Up 8 seconds               3306/tcp
redmine-redmine-1   docker.io/bitnami/redmine:5.1.2   "/opt/bitnami/script…"   redmine   9 seconds ago    Exited (1) 2 seconds ago
user@hogehoge:~/redmine# docker logs redmine-redmine-1
redmine 07:09:07.49 INFO  ==>
redmine 07:09:07.50 INFO  ==> Welcome to the Bitnami redmine container
redmine 07:09:07.50 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
redmine 07:09:07.50 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
redmine 07:09:07.50 INFO  ==>
redmine 07:09:07.52 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
redmine 07:09:07.53 INFO  ==> Validating settings in POSTGRESQL_CLIENT_* env vars
redmine 07:09:07.59 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
redmine 07:09:07.61 INFO  ==> Restoring persisted Redmine installation
redmine 07:09:07.68 INFO  ==> Trying to connect to the database server
redmine 07:09:12.85 INFO  ==> Executing database migrations
なので、一つずつプラグインを手作業で導入することに。
まずは、addtionalsプラグインの導入から
root@8556325049dc:/opt/bitnami/redmine# bundle config set --local without 'development test'
You are replacing the current local value of without, which is currently "development:sqlite:test" 
root@8556325049dc:/opt/bitnami/redmine# bundle install
Don't run Bundler as root. Installing your bundle as root will break this application for all non-root users on this
machine.
The list of sources changed, the dependencies in your gemfile changed, the gemspecs for path gems changed, but the
lockfile can't be updated because frozen mode is set

You have added to the Gemfile:
* additionals

Run `bundle install` elsewhere and add the updated Gemfile to version control.
If this is a development machine, remove the Gemfile.lock freeze by running `bundle config set frozen false`.
root@8556325049dc:/opt/bitnami/redmine# bundle config set frozen false
root@8556325049dc:/opt/bitnami/redmine# bundle install
Don't run Bundler as root. Installing your bundle as root will break this application for all non-root users on this
machine.
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching polyglot 0.3.5
Fetching rainbow 3.1.1
Fetching temple 0.10.3
Fetching tilt 2.3.0
Fetching tanuki_emoji 0.9.0
Fetching render_async 2.1.11
Fetching rss 0.3.0
Installing rainbow 3.1.1
Installing polyglot 0.3.5
Installing tilt 2.3.0
Installing render_async 2.1.11
Installing temple 0.10.3
Installing rss 0.3.0
Fetching deface 1.9.0
Installing deface 1.9.0
Installing tanuki_emoji 0.9.0
Fetching slim 5.2.1
Installing slim 5.2.1
Fetching redmine_plugin_kit 1.0.4
Installing redmine_plugin_kit 1.0.4
Fetching slim-rails 3.6.3
Installing slim-rails 3.6.3
Bundle complete! 45 Gemfile dependencies, 88 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `./vendor/bundle`
additionalsプラグインは、rakeコマンドを実行せずに、Redmineコンテナの再起動で導入できます。

引き続いて、additional_tagsプラグインの導入作業を実施。

root@8556325049dc:/# cd /opt/bitnami/redmine/plugins
root@8556325049dc:/opt/bitnami/redmine/plugins# ls ・・対象のプラグインファイルが村債することを確認
additional_tags         redmine_close_button          redmine_logs                      redmine_work_time
additionals             redmine_code_review           redmine_monitoring_controlling    sidebar_hide
redmine_absolute_dates  redmine_issues_panel          redmine_theme_changer
redmine_banner          redmine_issues_summary_graph  redmine_vividtone_my_page_blocks
root@8556325049dc:/opt/bitnami/redmine/plugins# cd ..
root@8556325049dc:/opt/bitnami/redmine# bundle install
Don't run Bundler as root. Installing your bundle as root will break this application for all non-root users on this
machine.
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching acts-as-taggable-on 10.0.0
Installing acts-as-taggable-on 10.0.0
Bundle complete! 46 Gemfile dependencies, 90 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `./vendor/bundle`
root@8556325049dc:/opt/bitnami/redmine# bundle exec rake --trace redmine:plugins:migrate RAILS_ENV=production ・・additional_tagsプラグインではrakeコマンドの実行が必要
** Invoke redmine:plugins:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:plugins:migrate
== 20201116145429 ActsAsTaggableMigration: migrating ==========================
-- create_table("additional_tags")
   -> 0.0490s
-- create_table("additional_taggings")
   -> 0.1166s
-- execute("ALTER TABLE additional_tags MODIFY name varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;")
   -> 0.1187s
== 20201116145429 ActsAsTaggableMigration: migrated (0.2871s) =================

== 20201123093214 MigrateExistingTags: migrating ==============================
-- table_exists?("tags")
   -> 0.0022s
-- table_exists?("taggings")
   -> 0.0020s
== 20201123093214 MigrateExistingTags: migrated (2.2157s) =====================

** Invoke db:schema:dump (first_time)
** Invoke db:load_config (first_time)
** Invoke environment
** Execute db:load_config
** Execute db:schema:dump
root@8556325049dc:/opt/bitnami/redmine# exit

コンテナから抜けて、redmineコンテナを再スタート(docker compose restrat redmine)させれば問題なく利用できる状況になった!
ということで、管理のページのスクショはこれ。

何気に、右下に表示されるadditionalsプラグインの「トップへ」のリンク機能が自分には便利です。
(追記)
もちろん、DockerコンテナをDocker compose downで停止してしまうと、最初に遭遇したように、再度の起動時にはエラーが起きます。
停止時には、docker compose stop コマンドを使用しましょう。



(赤字は、前回稼働確認時からバージョンが変更となっているもの)
導入確認済 plugins:(05/26現在) 4.X.X導入 バージョン 5.1.2導入検証 備考
14 additionals (未確認) 3.3.0-main★ 正常稼働 https://github.com/alphanodes/additionals で最新版を入手
15 additional_tags (未確認) 3.3.0-main★ 正常稼働 https://github.com/alphanodes/additional_tags で最新版を入手