heroku - 如何调试自定义 Heroku buildpack : release script not being driven

标签 heroku eclipse-virgo buildpack

我正在开发 Eclipse Virgo buildpack但是当我用 Heroku 尝试并推送 trivial app 时,检测失败:

-----> Fetching custom git buildpack... done
!     Heroku push rejected, no Cedar-supported app detected

buildpack 的检测脚本在应用程序的根目录中本地运行良好:

$[...]virgo-buildpack/bin/detect .
Virgo Web

关于如何调试这个的任何提示?我尝试将检测脚本写入 stdout 和 stderr,但输出没有出现在“heroku logs”下。

我正在运行 Mac OS X 10.8.2、Ruby 1.9.3p374 和 gems 1.8.23。

更新:根据前两个答案,我在驱动 detect.rb 脚本之前使用了 bash 检测脚本来安装丢失的 gem。我还更改了 buildpack 脚本以写入标准输出。

heroku 推送更进一步,但仍然失败。我可以看到编译脚本正在退出,但是发布 bash 脚本在开始时有一个 echo 命令,并且它没有出现在输出中。

看来发布脚本没有被调用。

输出结果如下(#表示注释以避免困惑):

-----> Fetching custom git buildpack... done
# detect script enter and exit
Virgo Web app detected
# compile script enter and exit
-----> Discovering process types
       Procfile declares types                                                                                                                                                                                                                                                                                                                                                                                             


                               -> (none)
# detect script enter and exit (again)
Virgo Web -> web

-----> Compiled slug size: 60.4MB
-----> Launching... !     Heroku push rejected, failure releasing code

heroku logs --tail 简单地显示:

2013-03-06T10:53:48+00:00 heroku[slugc]: Slug compilation started
2013-03-06T10:54:27+00:00 heroku[slugc]: Slug compilation failed: failure releasing code

最佳答案

对于自定义 buildpack,detect 脚本实际上不需要那么复杂,因为无论如何用户都将使用 BUILDPACK_URL 手动指定它。复杂的 detect 脚本实际上只对默认的 Heroku buildpacks 有意义,因为它们需要检测 buildpack 是否适用于任何给定的应用程序。

如果你想完全赌上检测,你可以逃避这样的事情:

#!/usr/bin/env bash
# bin/detect <build-dir>

echo "Vergo"
exit 0

一旦你开始工作(并解决了 compilerelease 的任何问题),你可以让它更智能一些。例如,您可以检测某个文件模式是否存在:

#!/usr/bin/env bash
# bin/detect <build-dir>
if [ -f $1/index.jsp ]; then
  echo "Vergo" && exit 0
else
  echo "no" && exit 1
fi

此外,说到简单性,您的构建包似乎是基于 Ruby buildpack ,这是目前最复杂的问题之一。您可能想看看 list of third-party buildpacks看看大多数是如何在简单的 bash 中完成的。

关于heroku - 如何调试自定义 Heroku buildpack : release script not being driven,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15161296/

相关文章:

java - 我不知道如何安装部署在 heroku 上的应用程序所需的 libXtst.so.6 库

osgi - 如何为每个客户端配置 OSGi 服务

java - OSGi:如何获取其他包的类加载器

Amazon AWS Buildpack 中完美的服务器部署

heroku - 如何在 Heroku 上安装 libffi-dev?

django - 在 Heroku 上编辑 Django 文件而不编辑我的数据库文件

java - 使用heroku war时如何在Heroku中编辑Procfile :deploy myapp. war

java - Eclipse Virgo : Different startup order on Linux vs. Windows => 如何修复?

java - 瑞士电信应用云 : nodejs with java jdk

heroku - Selenium 和 Chrome buildpack 安装可以缓存在 HerokuCI 上吗?