5

I want to deploy a Play 2.0.4 app on Heroku using git push heroku master but I have moved the play root folder into a sub folder of my git repo. Is there a way to deploy from there?

Currently it misidentifies my project as a 1.2.4 Play app, then the compilation and the deployment fails.

-----> Play! app detected
-----> WARNING: Play! version not specified in dependencies.yml. Default version: 1.2.4 being used....
-----> Installing Play! 1.2.4.....
-----> done
-----> Installing ivysettings.xml..... done
-----> Building Play! application...
Tamas
  • 3,254
  • 4
  • 29
  • 51

3 Answers3

4

Install this git plugin.

https://github.com/apenwarr/git-subtree

Run "git subtree push --prefix **subfolder with app" heroku master"

Brian Petro
  • 1,577
  • 16
  • 32
  • Thanks! It looks promising, but now the push failed like this: `hint: Updates were rejected because the tip of your current branch is behind its remote counterpart. Merge the remote changes (e.g. 'git pull') before pushing again.` Any idea how to fix this? Maybe a clean heroku repo would work. – Tamas Jan 11 '13 at 22:28
  • 1
    This solved the merge issue: git push heroku `git subtree split --prefix website master`:master --force from [link](http://stackoverflow.com/questions/12644855/how-do-i-reset-a-heroku-git-repository-to-its-initial-state) – Tamas Jan 11 '13 at 22:40
0

You can add the version of Play you would like to a conf/dependencies.yml file your repo.

dependencies.yml:

# Application dependencies

require:
    - play 2.0.4

It will then load the correct Play version.

Dan Hoerst
  • 6,222
  • 2
  • 38
  • 51
  • Thanks, but it doesn't seem to work. It only affects the deploy if I move the config to `/conf/dependencies.yml` but my play project is in the `/play` subdirectory. – Tamas Jan 11 '13 at 22:18
  • I would follow through this: https://devcenter.heroku.com/articles/play. Does the push work if your play project is in the root of the repo? – Dan Hoerst Jan 11 '13 at 22:21
  • Yes it works if it's in the root. But I just moved it into a subdirectory and I want to keep it that way. – Tamas Jan 11 '13 at 22:24
0

I had the same issue, surprisingly no generic solution found. So I wrote a buildpack myself. Hope it is helpful https://github.com/timanovsky/subdir-heroku-buildpack