NotePublic/Software/Applications/Redmine/Docker_方式安装_Redmine.md

134 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Docker 方式安装 Redmine
容器名称为 redmine。
```bash
# Run Redmine with SQLite3
docker run -d -p 9001:3000 --name redmine redmine
# Run Redmine with a Database Container
docker run -d --name redminedb -v "$PWD/database":/var/lib/mysql -e MYSQL_USER=root -e MYSQL_PASSWORD=<password> -e MYSQL_DATABASE=redmine -e MYSQL_ROOT_PASSWORD=<password> mariadb:latest
docker run -d --name redmine --link redminedb:mysql -p 9001:3000 -e REDMINE_DB_MYSQL=redminedb -e REDMINE_DB_USERNAME=root -e REDMINE_DB_PASSWORD=<password> -v /home/web/bin/redmine/config/configuration.yml:/usr/src/redmine/config/configuration.yml -v /home/web/bin/redmine/log:/usr/src/redmine/log -v /home/web/bin/redmine/data:/home/redmine/data -v /home/web/bin/redmine/plugins:/usr/src/redmine/redmine/redmine/plugins redmine:latest
```
之后使用默认用户名密码登陆admin/admin
## 登录后配置
角色增加:
- Manager
- Tester
- Developer
问题状态增加:
- 新建
- 待审核
- 已指派
- 不处理
- 进行中
- 已解决
- 测试中
- 已验证
跟踪标签增加:
- 里程碑
- 任务
- 需求用例
- 功能
- 缺陷
- 需求单
- 维护单
- 故障单
- 发布申请单
枚举中为问题优先级增加:
- 普通
- 优先
- 紧急
## config/configuration.yml 文件配置
### 附件设置
```yml
attachments_storage_path: /path/to/attachments
attachments_mas_size: 51200
```
### 电子邮件服务器配置
```yml
# For exmail.qq.com
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "smtp.exmail.qq.com"
port: 465
domain: 'smtp.exmail.qq.com'
authentication: login
user_name: 'noreply@xxx.com'
password: '******'
ssl: true
enable_starttls_auto: true
# For smtp.163.com
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "smtp.163.com"
port: 25
domain: 'smtp.163.com'
authentication: :login
user_name: 'noreply@xxx.com'
password: '******'
```
邮件测试redmine 的 配置->邮件通知 页面,设定之后点击“发送测试邮件”即可确认。成功之后,登陆用户会收到从设置的邮箱服务器发来的一封 email否则会在设置页面中提示相关错误。
## 容器配置
### 进入 Redmine 容器命令行
```bash
docker exec -it redmine bash
```
### 安装插件
下载插件到容器的 /usr/src/redmine/plugins 目录中。
执行以下命令:
```bash
bundle install
RAILS_ENV=production bundle exec rake redmine:plugins:migrate NAME=<plugin name>
```
### 插件列表
- [Custom Workflows](https://www.redmine.org/plugins/custom-workflows)
- [Redmine Issue Autoflow](https://redmineplugins.cn/projects/1/plugin_blocks/36?tab=general)
### Custom Workflows 插件
在 管理->Custom Workflows 中 Create a custom workflow。
输入名称,设置 Observable object设置项目。
脚本参考示例如下:
```ruby
if self.status_id==4
self.assigned_to = User.find_by(login: 'lion')
elsif self.status_id==6
self.assigned_to = User.find_by(login: 'rick')
elsif self.status_id==8
self.assigned_to = self.author
end
```
脚本支持直接调用 Redmine App 模块接口,具体 API 参考:<https://github.com/redmine/redmine/tree/master/app/models> 中的文件。