【问题标题】:Deploy Play app on Heroku from a subdirectory of git repo从 git repo 的子目录在 Heroku 上部署 Play 应用程序
【发布时间】:2013-01-11 20:39:24
【问题描述】:

我想使用git push heroku master 在 Heroku 上部署 Play 2.0.4 应用程序,但我已将 play 根文件夹移动到我的 git repo 的子文件夹中。有没有办法从那里部署?

目前它错误地将我的项目识别为 1.2.4 Play 应用程序,然后编译和部署失败。

-----> 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...

【问题讨论】:

    标签: deployment heroku playframework-2.0


    【解决方案1】:

    安装这个 git 插件。

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

    运行“git subtree push --prefix **subfolder with app”heroku master”

    【讨论】:

    • 谢谢!看起来很有希望,但现在推送失败如下: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. 知道如何解决这个问题吗?也许一个干净的heroku repo会起作用。
    • 这解决了合并问题:git push heroku git subtree split --prefix website master:master --force from link
    【解决方案2】:

    您可以将您想要的 Play 版本添加到 conf/dependencies.yml 文件中。

    dependencies.yml:

    # Application dependencies
    
    require:
        - play 2.0.4
    

    然后它将加载正确的 Play 版本。

    【讨论】:

    • 谢谢,但它似乎不起作用。如果我将配置移动到/conf/dependencies.yml,它只会影响部署,但我的游戏项目位于/play 子目录中。
    • 我会遵循这个:devcenter.heroku.com/articles/play。如果您的 play 项目位于 repo 的根目录中,推送是否有效?
    • 是的,如果它在根目录中,它就可以工作。但我只是把它移到了一个子目录中,我想保持这种状态。
    【解决方案3】:

    我遇到了同样的问题,令人惊讶的是没有找到通用的解决方案。所以我自己写了一个buildpack。希望对您有所帮助 https://github.com/timanovsky/subdir-heroku-buildpack

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-23
      • 2014-12-06
      • 1970-01-01
      • 1970-01-01
      • 2017-05-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多