LoginSignup
3
3

Redmineへのpluginインストール(agile/issue_templates/work_time/checklists)

Last updated at Posted at 2023-07-21

はじめに

現在所属しているプロジェクトでRedmineを使ってタスク管理を行っている
プロジェクトではSRE体制を目指しており、アジャイル開発プロセスを導入しているためプロジェクトのタスク管理に役立ちそうなpluginをいくつかインストールする
pluginインストールにあたってはgit cloneを利用してソースをダウンロードする手法が一般的なようだが、インターネットへ接続できない閉域環境でのインストールを想定してコンテナへはファイルコピーによってソースを転送することとした

環境情報

  • OS: Windows 10 Pro 22H2
  • RAM: 8.0GB
  • SSD: 256GB
  • Podman Desktop: v1.1.0
  • Podman: v4.5.1
  • Redmine(Bitnami): v4.2.5.stable

agileインストール

何らかのカンバンボートを導入したいと考えてpluginを探したところ、backlogs , agile , kanban あたりがあることがわかった。
プロジェクトではScrum開発を取り入れており、カンバンにSprintの概念を盛り込みたかったためagileを選択した(kanbanにはSprintの概念がなさそう)

RedmineUP REDMINE AGILE(アジャイル)プラグインダウンロードをクリックする
image.png

Light版は無料でダウンロードができるのでダウンロード中をクリックする
image.png

メールアドレスの登録が必要なため、登録の上メールにて送信されてきたURLからソースをダウンロードする
image.png

ダウンロードしたzipファイルを端末の任意のドライブに解凍する

Windows PowerShell(管理者)にてWSLでpodman-machine-defaultを実行する

PS C:\WINDOWS\system32> wsl -d podman-machine-default

You will be automatically entered into a nested process namespace where
systemd is running. If you need to access the parent namespace, hit ctrl-d
or type exit. This also means to log out you need to exit twice.

[user@hostname ~]$

端末のCドライブ/mnt/cにマウントされているので、pluginのソースファイルをredmineコンテナの/opt/bitnami/redmine/plugins ディレクトリへコピーする

[user@hostname ~]$ podman cp /mnt/c/Home/Tool/podman/redmine/redmine_agile user_redmine_1:/opt/bitnami/redmine/plugins/.
[user@hostname ~]$

redmineコンテナにbash接続する

[user@hostname ~]$ podman exec -it user_redmine_1 bash
#

以下コマンドでpluginをインストールする

# cd /opt/bitnami/redmine
# bundle install --without development test --no-deployment
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'development test'`, and stop using this flag
[DEPRECATED] The `--no-deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'false'`, and stop using this flag
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this
application for all non-root users on this machine.
[DEPRECATED] This Gemfile does not include an explicit global source. Not using an explicit global source may result in a different lockfile being generated depending on the gems you have installed locally before bundler is run. Instead, define a global source in your Gemfile like this: source "https://rubygems.org".
Could not find gem 'redmine_crm' in locally installed gems.

エラーを解決するためにgem installにてredmine_crmをインストールする

# gem install redmine_crm

こちらでもエラーが発生する
例えば、raccのインストールが失敗しており、エラーメッセージに従ってmkmf.logを参照すると以下のメッセージが出力されている

# cat /opt/bitnami/ruby/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0-static/racc-1.7.1/mkmf.log
"gcc -o conftest -I/opt/bitnami/ruby/include/ruby-2.6.0/x86_64-linux -I/opt/bitnami/ruby/include/ruby-2.6.0/ruby/backward -I/opt/bitnami/ruby/include/ruby-2.6.0 -I. -I/opt/bitnami/ruby/include   -s conftest.c  -L. -L/opt/bitnami/ruby/lib -Wl,-rpath,/opt/bitnami/ruby/lib -L. -Wl,-rpath=/opt/bitnami/ruby/lib -L/opt/bitnami/ruby/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/opt/bitnami/ruby/lib -L/opt/bitnami/ruby/lib -lruby-static -lz -lpthread -lrt -lrt -ldl -lcrypt -lm   -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

gccの-lオプションで指定されているライブラリが不足している可能性が疑われる
以下で一通りインストールしてみる
他にもインストールが失敗するたびに、mkmf.logを確認して順次対応していく
ちなみにchatGPTにメッセージを入力して対処方法を質問することで有益な回答を得ることができた
aptコマンドで以下インストールすることでbundle installがエラーなく完了することができた

# apt update
# apt install zlib1g-dev 
# apt install libpthread-stubs0-dev
# apt install libc6-dev
# apt install build-essential
# apt install ruby-dev
# apt install libmariadb-dev
# apt install libpq-dev
# apt install libruby

再度bundle installを実行

# bundle install --without development test --no-deployment
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'development test'`, and stop using this flag
[DEPRECATED] The `--no-deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'false'`, and stop using this flag
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this
application for all non-root users on this machine.
Bundler 2.3.11 is running, but your lockfile was generated with 2.3.8. Installing Bundler 2.3.8 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.3.8
Installing bundler 2.3.8
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'development test'`, and stop using this flag
[DEPRECATED] The `--no-deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'false'`, and stop using this flag
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this
application for all non-root users on this machine.
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the /opt/bitnami/redmine/Gemfile freeze
by running `bundle config unset deployment`.

The dependencies in your gemfile changed

You have added to the Gemfile:
* redmine_crm
#

メッセージに書かれている通りに bundle config unset deployment を実行

# bundle config unset deployment

再度bundle installを実行

# bundle install --without development test --no-deployment

bundle installが完了したら以下コマンドを実行

# bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production

以下でredmineのコンテナを再起動する

# exit
[user@hostname ~]$ podman restart user_redmine_1

プラウザから自端末のredmineへアクセスしてログインするとAgileタブが現れている
image.png

issue_templateインストール

チケットのテンプレートを登録できるプラグイン
あらかじめ題名と「説明」を入力したテンプレートを登録し、「新しいチケット」画面でテンプレートを選ぶと入力された状態で表示することができる
チケットの説明欄に記入例や定型文を入力するなどの使い方を想定

GetHub issue_teplates からソースをダウンロードする

Windows PowerShell(管理者)にてWSLでpodman-machine-defaultを実行する

PS C:\WINDOWS\system32> wsl -d podman-machine-default

You will be automatically entered into a nested process namespace where
systemd is running. If you need to access the parent namespace, hit ctrl-d
or type exit. This also means to log out you need to exit twice.

[user@hostname ~]$

端末のCドライブ/mnt/cにマウントされているので、pluginのソースファイルをredmineコンテナの/opt/bitnami/redmine/plugins ディレクトリへコピーする

[user@hostname ~]$ podman cp /mnt/c/Home/Tool/podman/redmine/redmine_issue_templates user_redmine_1:/opt/bitnami/redmine/plugins/.
[user@hostname ~]$

redmineコンテナにbash接続する

[user@hostname ~]$ podman exec -it user_redmine_1 bash
#

以下コマンドでpluginをインストールする

# cd /opt/bitnami/redmine
# bundle install --without development test --no-deployment
# bundle exec rake redmine:plugins NAME=issue_templates RAILS_ENV=production

以下でredmineのコンテナを再起動する

# exit
[user@hostname ~]$ podman restart user_redmine_1

プラウザから自端末のredmineへアクセスしてログインし、管理 -> プラグイン へ行くとIssue Templates プラグインがインストールされていることが確認できる
image.png

work_timeインストール

Redmineでは各チケットに作業時間を記録することができる
work_time プラグインは日単位でチケットを一覧表示し、作業時間を記録/参照することができる

GetHub work_time からソースをダウンロードする

Windows PowerShell(管理者)にてWSLでpodman-machine-defaultを実行する

PS C:\WINDOWS\system32> wsl -d podman-machine-default

You will be automatically entered into a nested process namespace where
systemd is running. If you need to access the parent namespace, hit ctrl-d
or type exit. This also means to log out you need to exit twice.

[user@hostname ~]$

端末のCドライブ/mnt/cにマウントされているので、pluginのソースファイルをredmineコンテナの/opt/bitnami/redmine/plugins ディレクトリへコピーする

[user@hostname ~]$ podman cp /mnt/c/Home/Tool/podman/redmine/redmine_work_time user_redmine_1:/bitnami/redmine/plugins/.
[user@hostname ~]$

redmineコンテナにbash接続する

[user@hostname ~]$ podman exec -it user_redmine_1 bash
#

以下コマンドでpluginをインストールする

# cd /opt/bitnami/redmine
# bundle exec rake redmine:plugins:migrate RAILS_ENV=production

以下でredmineのコンテナを再起動する

# exit
[user@hostname ~]$ podman restart user_redmine_1

プラウザから自端末のredmineへアクセスしてログインし、管理 -> プラグイン へ行くとWork Time プラグインがインストールされていることが確認できる
image.png

checklistsインストール

Redmineでは各チケットにチェックリストを追加できるようにするプラグイン
チケットの終了条件として複数タスクがある場合などに利用することを想定している

RedmineUP REDMINE CHECKLIST PLUGINダウンロードをクリックする
image.png

Light版は無料でダウンロードができるのでDownload nowをクリックする
image.png

メールアドレスの登録が必要なため、登録の上メールにて送信されてきたURLからソースをダウンロードする
image.png

ダウンロードしたzipファイルを端末の任意のドライブに解凍する

Windows PowerShell(管理者)にてWSLでpodman-machine-defaultを実行する

PS C:\WINDOWS\system32> wsl -d podman-machine-default

You will be automatically entered into a nested process namespace where
systemd is running. If you need to access the parent namespace, hit ctrl-d
or type exit. This also means to log out you need to exit twice.

[user@hostname ~]$

端末のCドライブ/mnt/cにマウントされているので、pluginのソースファイルをredmineコンテナの/opt/bitnami/redmine/plugins ディレクトリへコピーする

[user@hostname ~]$ podman cp /mnt/c/Home/Tool/podman/redmine/redmine_checklists user_redmine_1:/bitnami/redmine/plugi
ns/.
[user@hostname ~]$

redmineコンテナにbash接続する

[user@hostname ~]$ podman exec -it user_redmine_1 bash
#

以下コマンドでpluginをインストールする

# cd /opt/bitnami/redmine
# bundle install --without development test --no-deployment
# bundle exec rake redmine:plugins NAME=redmine_checklists RAILS_ENV=production

以下でredmineのコンテナを再起動する

# exit
[user@hostname ~]$ podman restart user_redmine_1

プラウザから自端末のredmineへアクセスしてログインし、管理 -> プラグイン へ行くとWork Time プラグインがインストールされていることが確認できる
image.png

今回のpluginのインストール手順

色々試行錯誤したが今回のpluginをインストールする際の手順は以下となった
(1)Windows PowerShell(管理者)にてWSLでpodman-machine-defaultを実行する

PS C:\WINDOWS\system32> wsl -d podman-machine-default

(2)pluginのソースファイルをredmineコンテナの/opt/bitnami/redmine/plugins ディレクトリへコピーする

[user@hostname ~]$ podman cp /mnt/c/Home/Tool/podman/redmine/redmine_agile user_redmine_1:/opt/bitnami/redmine/plugins/.
[user@hostname ~]$ podman cp /mnt/c/Home/Tool/podman/redmine/redmine_issue_templates user_redmine_1:/opt/bitnami/redmine/plugins/.
[user@hostname ~]$ podman cp /mnt/c/Home/Tool/podman/redmine/redmine_work_time user_redmine_1:/bitnami/redmine/plugins/.
[user@hostname ~]$ podman cp /mnt/c/Home/Tool/podman/redmine/redmine_checklists user_redmine_1:/bitnami/redmine/plugins/.

(3)redmineコンテナにbash接続する

[user@hostname ~]$ podman exec -it user_redmine_1 bash

(4)aptコマンドで以下をインストールする

# apt update
# apt install -y zlib1g-dev libpthread-stubs0-dev libc6-dev build-essential ruby-dev libmariadb-dev libpq-dev libruby

(5)redmine_crmをインストールする

# cd /opt/bitnami/redmine
# gem install redmine_crm

(6)以下コマンドを実行する

# bundle config unset deployment

(7)bundle installを実行する

# bundle install --without development test --no-deployment

(8)bundle execを実行

# bundle exec rake redmine:plugins:migrate RAILS_ENV=production

再度bundle installせよというメッセージが出力された場合は(7)と(8)を再度実施する

(9)redmineコンテナを再起動する

# exit
[user@hostname ~]$ podman restart user_redmine_1

おわりに

Redmine packaged by Bitnami(Container)におけるプラグインのインストールは基本的には以下の流れとなる

(1)ソースを/opt/bitnami/redmine/plugins/にソースのディレクトリを配置する
(2)cd /opt/bitnami/redmine を実施の上 bundle install --without development test --no-deployment を実行する
(3)bundle exec rake redmine:plugins:migrate RAILS_ENV=production を実行する
(4)podman restart コマンドにてRedmineコンテナを再起動する

bundle install時にライブラリの依存関係などでいくつかエラーが発生したが、今回はchatGPTを利用することで効果的にエラーを解消することができた

参考ページ

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3