Heroku: Using External Mounts on the Local File System

I know that you can install the Amazon S3 bucket using Fuse (s3fs [or s3fsr ruby ​​gem?]).

My case is specific to Heroku.

The Heroku file system is designed to be scalable only, but is there a way to mount Amazon s3 on the Heroku file system?

In my case, I use Redmine on Heroku and would like to use Redmine to manage git repositories to associate code reviews with my problems. Redmine needs to clone the repository into a local directory, which is possible but not persistent in Heroku.

I would like Redmine to maintain a git repository on a mounted S3 bucket. Is it possible? If it were possible, how slow would it be? Are there any other alternatives to achieve this?

+4
source share
2 answers

I did not find the perfect answer to my question, but the workaround here is OK.

You can override the default download of the Heroku script (and much more) by creating a file called Procfile in the root of your project.

Here's the procfile:

# run custom boot scirpt
web: sh /app/config/web-boot.sh

He tells Herok that this script loads Redmine.

I use Bitbucket with a private repository, so I created an SSH key pair and put them in 'config / ssh /'. Then I added the public key to my Bitbucket account deployment keys and added the Bitbucket public key to the file "config / ssh / know_hosts"

Here is the config / web-boot.sh file:

# move ssh keys
mkdir /app/.ssh
cp /app/config/ssh/* /app/.ssh/

# git clone code repos
mkdir /tmp/repos

# Do this for every repo you want to clone
git clone --bare ssh://git@bitbucket.org/[YOUR_ACCOUNT]/[YOUR_REPO].git /tmp/repos/[YOUR_REPO]
git --git-dir=/tmp/repos/[YOUR_REPO] remote add origin ssh://git@bitbucket.org/[YOUR_ACCOUNT]/[YOUR_REPO].git
git --git-dir=/tmp/repos/[YOUR_REPO] fetch origin

# run Unicorn http server
cd /app
bundle exec unicorn -p $PORT -c ./config/unicorn.rb

Then you can simply add the Git repository to your Redmine project by specifying '/ tmp / repos / [YOUR_REPO]'

Redmine Bitbucket Hook plugin, Bitbucket.

, , , .

+1

, Heroku .profile.d/ .

https://devcenter.heroku.com/articles/profiled

, "post-commit hook" git push ( .git/hooks/post-commit), BitBucket .

https://www.kernel.org/pub/software/scm/git/docs/githooks.html

0

All Articles