/文章

redmine安装和卸载代码审计插件(redmine_code_review-0.6.2)和下载地址

今天上午安装了redmine,但是想安装一个代码审计的插件redmine_code_review-0.6.2,在网上下载老是被墙,好不容易下载下来了,可是放到redmine的plugins目录下刷新插件页没显示,郁闷,难道redmine的插件不是这么安装的?

找度娘一看,果然如此...   还得执行一个命令,真是麻烦呀.

看看我是怎么把他给安装上的吧

 

下载插件

wget http://r-labs.googlecode.com/files/redmine_code_review-0.3.1.zip

或者是自己去手动下载:  点我下载~~

PS:今天看这个文章的时候发现写错了,但是再找的时候却找不到我用的这个0.6.2版本的了,所以写个0.3.1的,大家可以下载我上传的那个版本.

unzip redmine_code_review-0.6.2.zip

将源文件解压到plugins下,注意解压后的内容应该是一个插件的文件夹,并包含一下文件

ls redmine_code_review

app  assets  config  db  GPL.txt  init.rb  lib  README.rdoc  test

 

安装插件

现在回到redmine的根目录执行一下命令,将插件的信息写入数据库中

1.x版本的执行

rake db:migrate_plugins RAILS_ENV=production

2.x版本的执行

rake redmine:plugins:migrate RAILS_ENV=production

执行命令时你会看见一下内容

Migrating redmine_code_review (Redmine Code Review plugin)...
==  CreateCodeReviews: migrating ==============================================
-- create_table(:code_reviews)
   -> 0.0830s
==  CreateCodeReviews: migrated (0.0832s) =====================================

==  AddUpdatedBy: migrating ===================================================
-- add_column(:code_reviews, "updated_by_id", :integer)
   -> 0.0454s
==  AddUpdatedBy: migrated (0.0456s) ==========================================

==  AddLockVersion: migrating =================================================
-- add_column(:code_reviews, "lock_version", :integer, {:null=>false, :default=>0})
   -> 0.0761s
==  AddLockVersion: migrated (0.0764s) ========================================

==  AddStatusChanged: migrating ===============================================
-- add_column(:code_reviews, "status_changed_from", :integer)
   -> 0.0542s
-- add_column(:code_reviews, "status_changed_to", :integer)
   -> 0.1069s
==  AddStatusChanged: migrated (0.1616s) ======================================

==  CreateCodeReviewUserSettings: migrating ===================================
-- create_table(:code_review_user_settings)
   -> 0.0194s
==  CreateCodeReviewUserSettings: migrated (0.0197s) ==========================

==  LinkToIssue: migrating ====================================================
-- add_column(:code_reviews, "issue_id", :integer)
   -> 0.0425s
-- rename_column(:code_reviews, "status", "old_status")
   -> 0.0728s
-- rename_column(:code_reviews, "comment", "old_comment")
   -> 0.0571s
-- rename_column(:code_reviews, "parent_id", "old_parent_id")
   -> 0.0446s
==  LinkToIssue: migrated (0.2182s) ===========================================

==  RenameUser: migrating =====================================================
-- rename_column(:code_reviews, "user_id", "old_user_id")
   -> 0.0761s
==  RenameUser: migrated (0.0763s) ============================================

==  CreateCodeReviewProjectSettings: migrating ================================
-- create_table(:code_review_project_settings)
   -> 0.0564s
==  CreateCodeReviewProjectSettings: migrated (0.0566s) =======================

==  AddHideTab: migrating =====================================================
-- add_column(:code_review_project_settings, "hide_code_review_tab", :boolean, {:default=>false})
   -> 0.0937s
==  AddHideTab: migrated (0.0941s) ============================================

==  AddActionType: migrating ==================================================
-- add_column(:code_reviews, "action_type", :string)
   -> 0.0737s
-- add_column(:code_reviews, "file_path", :string)
   -> 0.0834s
-- add_column(:code_reviews, "rev", :string)
   -> 0.0588s
-- add_column(:code_reviews, "rev_to", :string)
   -> 0.0676s
==  AddActionType: migrated (0.3481s) =========================================

==  AddAutoRelation: migrating ================================================
-- add_column(:code_review_project_settings, "auto_relation", :integer, {:default=>1})
   -> 0.0566s
==  AddAutoRelation: migrated (0.0569s) =======================================

==  AddAttachmentId: migrating ================================================
-- add_column(:code_reviews, "attachment_id", :integer)
   -> 0.0469s
==  AddAttachmentId: migrated (0.0471s) =======================================

==  AddFileCount: migrating ===================================================
-- add_column(:code_reviews, "file_count", :integer, {:null=>false, :default=>0})
   -> 0.0490s
==  AddFileCount: migrated (0.0564s) ==========================================

==  CreateCodeReviewAssignments: migrating ====================================
-- create_table(:code_review_assignments)
   -> 0.0169s
==  CreateCodeReviewAssignments: migrated (0.0171s) ===========================

==  AddAssignmentTracker: migrating ===========================================
-- add_column(:code_review_project_settings, "assignment_tracker_id", :integer)
   -> 0.0389s
==  AddAssignmentTracker: migrated (0.0390s) ==================================

==  AddChangesetId: migrating =================================================
-- add_column(:code_review_assignments, "changeset_id", :integer)
   -> 0.0757s
==  AddChangesetId: migrated (0.0758s) ========================================

==  AddAutoAssign: migrating ==================================================
-- add_column(:code_review_project_settings, "auto_assign", :text)
   -> 0.0735s
==  AddAutoAssign: migrated (0.0740s) =========================================

==  AddLockVersionToProjectSettings: migrating ================================
-- add_column(:code_review_project_settings, "lock_version", :integer, {:null=>false, :default=>0})
   -> 0.0475s
==  AddLockVersionToProjectSettings: migrated (0.0477s) =======================

==  DeleteOldFields: migrating ================================================
-- remove_column(:code_reviews, "old_parent_id")
   -> 0.0561s
-- remove_column(:code_reviews, "old_user_id")
   -> 0.0892s
-- remove_column(:code_reviews, "old_comment")
   -> 0.0754s
-- remove_column(:code_reviews, "old_status")
   -> 0.0759s
==  DeleteOldFields: migrated (0.2975s) =======================================

==  AddTrackerToReviewDialog: migrating =======================================
-- add_column(:code_review_project_settings, "tracker_in_review_dialog", :boolean, {:default=>false})
   -> 0.0802s
==  AddTrackerToReviewDialog: migrated (0.0804s) ==============================

==  AddDiffAll: migrating =====================================================
-- add_column(:code_reviews, "diff_all", :boolean)
   -> 0.0751s
==  AddDiffAll: migrated (0.0753s) ============================================

此时,表示你的插件已经安装成功了

 

现在重启redmine服务

ps -ef

找到一下内容

root     30253     1  0 10:21 ?        00:00:05 ruby script/rails server webrick -e production -d

取出第二个参数,也就是PID号,然后执行下边的命令,将进程强行杀死

kill -9 30253

然后启动你的redmine,比如我的是在redmine的目录下执行(当然你也可以使用绝对路径,看自己的喜好...)

ruby script/rails server webrick -e production -d

 

现在再刷新一下你的插件页就能看见你刚才安装的插件了.

插件列表查看:  首页-->管理-->插件

 

卸载插件

安装比较容易,卸载相对繁琐了一点,因为在卸载的时候需要指定你的插件的名字,也许你会去网页的插件页去看看名字,但是这个貌似不是耶,我试过,至少这个代码审计的不是,但是我也有办法知道他叫什么.

此时你可以在执行一边插件安装的命令

rake redmine:plugins:migrate RAILS_ENV=production

他会提示你已经有哪几个插件安装了,而且有插件的名字

就像这个代码审计的插件一样

Migrating redmine_code_review (Redmine Code Review plugin)...

 redmine_code_review  这个就是他的名字啦,哈哈

现在咱们可以执行卸载命令了

1.x版本的执行

rake db:migrate:plugin NAME=redmine_code_review VERSION=0 RAILS_ENV=production

2.x版本的执行

rake redmine:plugins:migrate NAME=redmine_code_review VERSION=0 RAILS_ENV=production

你会看见如下的内容

Migrating redmine_code_review (Redmine Code Review plugin)...
==  AddDiffAll: reverting =====================================================
-- remove_column(:code_reviews, "diff_all")
   -> 0.0604s
==  AddDiffAll: reverted (0.0606s) ============================================

==  AddTrackerToReviewDialog: reverting =======================================
-- remove_column(:code_review_project_settings, "tracker_in_review_dialog")
   -> 0.0985s
==  AddTrackerToReviewDialog: reverted (0.0988s) ==============================

==  DeleteOldFields: reverting ================================================
-- add_column(:code_reviews, "old_parent_id", :integer)
   -> 0.0933s
-- add_column(:code_reviews, "old_user_id", :integer)
   -> 0.1137s
-- add_column(:code_reviews, "old_comment", :text)
   -> 0.0235s
-- add_column(:code_reviews, "old_status", :integer)
   -> 0.0626s
==  DeleteOldFields: reverted (0.2939s) =======================================

==  AddLockVersionToProjectSettings: reverting ================================
-- remove_column(:code_review_project_settings, "lock_version")
   -> 0.0519s
==  AddLockVersionToProjectSettings: reverted (0.0528s) =======================

==  AddAutoAssign: reverting ==================================================
-- remove_column(:code_review_project_settings, "auto_assign")
   -> 0.0636s
==  AddAutoAssign: reverted (0.0638s) =========================================

==  AddChangesetId: reverting =================================================
-- remove_column(:code_review_assignments, "changeset_id")
   -> 0.0949s
==  AddChangesetId: reverted (0.0951s) ========================================

==  AddAssignmentTracker: reverting ===========================================
-- remove_column(:code_review_project_settings, "assignment_tracker_id")
   -> 0.0557s
==  AddAssignmentTracker: reverted (0.0558s) ==================================

==  CreateCodeReviewAssignments: reverting ====================================
-- drop_table(:code_review_assignments)
   -> 0.0074s
==  CreateCodeReviewAssignments: reverted (0.0075s) ===========================

==  AddFileCount: reverting ===================================================
-- remove_column(:code_reviews, "file_count")
   -> 0.0301s
==  AddFileCount: reverted (0.0303s) ==========================================

==  AddAttachmentId: reverting ================================================
-- remove_column(:code_reviews, "attachment_id")
   -> 0.0489s
==  AddAttachmentId: reverted (0.0501s) =======================================

==  AddAutoRelation: reverting ================================================
-- remove_column(:code_review_project_settings, "auto_relation")
   -> 0.0529s
==  AddAutoRelation: reverted (0.0534s) =======================================

==  AddActionType: reverting ==================================================
-- remove_column(:code_reviews, "action_type")
   -> 0.0555s
-- remove_column(:code_reviews, "file_path")
   -> 0.0670s
-- remove_column(:code_reviews, "rev")
   -> 0.0941s
-- remove_column(:code_reviews, "rev_to")
   -> 0.0343s
==  AddActionType: reverted (0.2516s) =========================================

==  AddHideTab: reverting =====================================================
-- remove_column(:code_review_project_settings, "hide_code_review_tab")
   -> 0.0443s
==  AddHideTab: reverted (0.0444s) ============================================

==  CreateCodeReviewProjectSettings: reverting ================================
-- drop_table(:code_review_project_settings)
   -> 0.0133s
==  CreateCodeReviewProjectSettings: reverted (0.0134s) =======================

==  RenameUser: reverting =====================================================
-- rename_column(:code_reviews, "old_user_id", "user_id")
   -> 0.0819s
==  RenameUser: reverted (0.0821s) ============================================

==  LinkToIssue: reverting ====================================================
-- remove_column(:code_reviews, "issue_id")
   -> 0.0428s
-- rename_column(:code_reviews, "old_status", "status")
   -> 0.0479s
-- rename_column(:code_reviews, "old_comment", "comment")
   -> 0.0926s
-- rename_column(:code_reviews, "old_parent_id", "parent_id")
   -> 0.0426s
==  LinkToIssue: reverted (0.2264s) ===========================================

==  CreateCodeReviewUserSettings: reverting ===================================
-- drop_table(:code_review_user_settings)
   -> 0.0054s
==  CreateCodeReviewUserSettings: reverted (0.0056s) ==========================

==  AddStatusChanged: reverting ===============================================
-- remove_column(:code_reviews, "status_changed_from")
   -> 0.0986s
-- remove_column(:code_reviews, "status_changed_to")
   -> 0.0277s
==  AddStatusChanged: reverted (0.1268s) ======================================

==  AddLockVersion: reverting =================================================
-- remove_column(:code_reviews, "lock_version")
   -> 0.0631s
==  AddLockVersion: reverted (0.0633s) ========================================

==  AddUpdatedBy: reverting ===================================================
-- remove_column(:code_reviews, "updated_by_id")
   -> 0.0545s
==  AddUpdatedBy: reverted (0.0547s) ==========================================

==  CreateCodeReviews: reverting ==============================================
-- drop_table(:code_reviews)
   -> 0.0098s
==  CreateCodeReviews: reverted (0.0100s) =====================================

是不是和安装的很相似,只是原来的添加变成了删除

现在依旧得重启一下redmine,这里就不再重述一遍了.

 

相关文章  在Centos6.3中安装Redmine2.3的一次小记

 

 

本文固定链接:http://www.bbtang.info/linux/fuwu/414.html 原文链接:redmine安装和卸载代码审计插件(redmine_code_review-0.6.2)和下载地址,转发请注明来源!
0 0

发表评论