Setting up and installing Redmine on Heroku - rotati/wiki GitHub Wiki
Redmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database.
Redmine is open source and released under the terms of the GNU General Public License v2 (GPL).
First you need to follow the following step:
Create your own repository or fork redmine project from remine official github site. Be aware of fork redmine from its github it will pull the latest version of redmine (3.2.X). So if you want a specific version of redmine you have to create an empty repository on github and download redmine from redmine official website (redmine.org). For this project we have downloaded the stable version 3.1.3 zip file one.
After clone the empty repository then we have to extract our redmine zip file into this empty cloned folder on our local machine. As we have redmine source code locally then we can make change and add some configuration to redmine project. Everytime we have locally change file we have commit to github repository on master branch or what every branch that you prefer. We can use git command as below:
$ git clone [email protected]:rotati/redmine.git
Before you can deploy your rails project to heroku be make sure have create app on heroku. For this project we have create heroku app called rotati-redmine. If we go to heroku setting of your created app you will get the githup URL for this app. This URL will be use on .git/config file in order to allow you to push from your master directory of github to heroku/master repository.
.git/config file
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = [email protected]:rotati/redmine.git
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "heroku"]
url = https://git.heroku.com/rotati-redmine.git
fetch=+refs/heads/*:refs/remotes/heroku/*
[branch "master"]
remote = origin
merge = refs/heads/master
Then we can use git command to deploy our app on heroku:
$ git add .
$ git commit -m 'something better'
$ git push heroku master
We have to add the configuration to configuration.yml with Amazon SES account as below:
config/configuration.yml
default:
email_delivery:
delivery_method: :smtp
smtp_settings:
enable_starttls_auto: true
address: <%= ENV['AWS_SES_ADDRESS'] %>
port: 465
ssl: true
domain: <%= ENV['DOMAIN'] %>
authentication: :login
user_name: <%= ENV['AWS_SES_USERNAME'] %>
password: <%= ENV['AWS_SES_PASSWORD'] %>
Noted: All Amazon SES credential should place on heroku env variables.
There is a great plugin for Redmine files upload to Amazon S3, it's called remine_s3 plugin. See the full source code and configuration Here.
What we have to do just follow the instruction with the link above. The main part is configure for config/s3.yml. See the configuration below:
production:
access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
bucket: <%= ENV['S3_BUCKET_NAME'] %>
region: 'ap-southeast-1'
folder: 'attachments'
endpoint: 's3-ap-southeast-1.amazonaws.com'
secure: false
private: false
expires: 1000
proxy: false
thumb_folder: 'tmp'
development:
access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
bucket: <%= ENV['S3_BUCKET_NAME'] %>
region: 'ap-southeast-1'
folder: 'attachments'
endpoint: 's3-ap-southeast-1.amazonaws.com'
secure: false
private: false
expires: 1000
proxy: false
thumb_folder: 'tmp'
# Uncomment this to run plugin tests with standart redmine script
# test:
# access_key_id:
# secret_access_key:
# bucket:
Note: Be aware to put all env variables such as AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and S3_BUCKET_NAME on Heroku env variables. Also noted that region and endpoint is for heroku server witch hosted in Singapore.