Table of Contents

Redmine related commands

Restart

touch tmp/restart.txt

Migrate plugins (Redmine 2.x)

rake redmine:plugins:migrate RAILS_ENV=production

Run Migration for single plugin starting with Version 0

rake db:migrate:plugin NAME=whitewall VERSION=0

Generate Migration:

rails generate migration IssueAddEditor

Set DEV Enviroment

Add following to config/environment.rb

# GET RID OF RESTART FOR EACH AND EVERY BLOODY CODE CHANGE!
ENV['RAILS_ENV'] ||= 'development'

Update Commit history:

./script/rails runner "Repository.fetch_changesets" -e production

Cron Reposman

Test run cron:

env -i sh -c "cd /var/www/redmine.knallimall.org/web/extra/svn/ && /usr/local/rvm/rubies/ruby-2.1.2/bin/ruby reposman.rb -s /var/www/git_repos/ -r https://rm.tagwork-one.de/ -u /var/www/git_repos/ --scm git -k XXXXXXXX-YOURKEY-XXXXXXX --owner web18 --group client1 --verbose"

Working cronJob example (pay attention to the ruby location):

*/1 * * * * /usr/local/rvm/wrappers/ruby-2.1.2/ruby /var/www/redmine.knallimall.org/web/extra/svn/reposman.rb -s /var/www/git_repos/ -r https://redmine.knallimall.org/ -u /var/www/git_repos/ --scm git -k XXXXXXXX-YOURKEY-XXXXXXX --owner web18 --group client1 --verbose

Redmine related code

Use Redmine built-in working-days feature

Include it in each contoller you want to use the function
include Redmine::Utils::DateCalculation

Use it:

@workDaysOnly = working_days(from, to)

Get assignable users:

@issue.assignable_users