Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dokku - Run Rails 4 app from Subfolder

My current Rails Application is split in to 2 folders.

/base  
/app

With base being referenced into app with the following line in my gemfile

gem 'base', path: "../base"

I'm trying to git deploy this repository to dokku - however this is failing and I'm assuming this is due to dokku not being able to determine the correct buildpack as it is only looking in the root to determine the app type etc.

A snippet from the dokku trace:

remote: + DOCKER_ARGS+=
remote: ++ docker run -d -v /home/dokku/sws/cache:/cache -e CACHE_PATH=/cache dokku/sws /build/builder
remote: + id=2439409a62c2da4c32086149ad404dd4c6ec974e83aa7fe0d8e06d092396b69f
remote: + docker attach 2439409a62c2da4c32086149ad404dd4c6ec974e83aa7fe0d8e06d092396b69f
-----> Unable to select a buildpack
remote: + exit_code=1
remote: + set -e

I've tried to use a config.ru as mentioned on Deploy a subdirectory to Heroku when dealing with the same issue on Heroku - but this does not appear to be working.

Any thoughts?

like image 329
Grant Trevor Avatar asked Oct 20 '22 17:10

Grant Trevor


1 Answers

I encountered a similar issue with my Node.js app where I have a repository with multiple folders and only one containing the Dokku-app. I figured out the following inelegant solution in form of bash-script:

#!/bin/bash

git init
git add . --all
git commit -m "dokku deploy"
git remote add dokku [dokkuserver]
git push dokku master
rm -rf .git

I simply run this script from the folder of my app. It creates an ad hoc git repository, pushes it to the Dokku and then removes local repository. The reason why I said this was inelegant solution was that I know that this is doable with some Git sub tree magic from top folder (my colleague did this some time ago) but I didn't had time to figure it out. Some one with more Git fu might help with that.

like image 91
Tumetsu Avatar answered Oct 30 '22 19:10

Tumetsu