Sch*_*ern 8 heroku buildpack heroku-ci
我刚开始使用HerokuCI.我有几个Selenium测试,所以我已经添加了buildpacks app.json.
{
"buildpacks": [
{ "url": "heroku/ruby" }
],
"environments": {
"test": {
"addons": ["heroku-postgresql:in-dyno", "heroku-redis:in-dyno"],
"buildpacks": [
{ "url": "heroku/ruby" },
{ "url": "https://github.com/notvad/heroku-buildpack-selenium" },
{ "url": "https://github.com/heroku/heroku-buildpack-chromedriver" },
{ "url": "https://github.com/heroku/heroku-buildpack-google-chrome" }
],
"env": {
"REDIS_PROVIDER": "REDIS_URL",
"RAILS_ENV": "test",
"RACK_ENV": "test",
"MALLOC_ARENA_MAX": 2,
"LANG": "en_US.UTF-8",
"TEST_API": 1
},
"scripts": {
"test-setup": "./bin/setup-cc-test-reporter",
"test": "./bin/test-with-cc-test-reporter"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
这些不断重建以及所有依赖项.
-----> Selenium app detected
bash: /tmp/buildpacks/b5ae60a477f2ba582d00a4ba23348059d40dea69cea6d982947f7c6afa72d2b8d69252449d43cbcf97a23341fd57300a3fef3224ace95482e1c0deaf8a844e4d/export: No such file or directory
bash: /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/export: No such file or directory
-----> Updating apt caches
Hit:1 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Reading package lists...
-----> Fetching .debs for xserver-xorg-core libgl1-mesa-dri xvfb libglide3 xfs unzip
Reading package lists...
Building dependency tree...
Package xfs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'xfs' has no installation candidate
-----> Installing adwaita-icon-theme_3.28.0-1ubuntu1_all.deb
-----> Installing at-spi2-core_2.28.0-1_amd64.deb
...and so on...
-----> Downloading and installing Selenium
-----> Writing profile script
-----> chromedriver app detected
bash: /tmp/buildpacks/b5ae60a477f2ba582d00a4ba23348059d40dea69cea6d982947f7c6afa72d2b8d69252449d43cbcf97a23341fd57300a3fef3224ace95482e1c0deaf8a844e4d/export: No such file or directory
bash: /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/export: No such file or directory
bash: /tmp/buildpacks/f55d0db8af2b8c70f2c0e028ef5430955852d9e4f07a06e333e54eb5264a81b9d1e77d1cc02851b4c7da30f6da47b13959e18a24c630212b899920d05f32a566/export: No such file or directory
-----> Looking up latest chromedriver version...
-----> Downloading chromedriver v2.43...
Archive: /tmp/chromedriver.zip
inflating: /app/.chromedriver/bin/chromedriver
-----> Creating chromedriver export scripts...
-----> Google Chrome app detected
bash: /tmp/buildpacks/b5ae60a477f2ba582d00a4ba23348059d40dea69cea6d982947f7c6afa72d2b8d69252449d43cbcf97a23341fd57300a3fef3224ace95482e1c0deaf8a844e4d/export: No such file or directory
bash: /tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/export: No such file or directory
bash: /tmp/buildpacks/f55d0db8af2b8c70f2c0e028ef5430955852d9e4f07a06e333e54eb5264a81b9d1e77d1cc02851b4c7da30f6da47b13959e18a24c630212b899920d05f32a566/export: No such file or directory
bash: /tmp/buildpacks/27353aa3b5edb2f8361186206e863f5d481f02805d02f0efdec439f3d30349a4fbdad2951af33a0492023fb0d90d26dafda6fe76f1b2d34f68564a98545f7022/export: No such file or directory
-----> Installing Google Chrome from the stable channel.
-----> Updating apt caches
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Reading package lists...
-----> Fetching .debs for gconf-service
...and so on...
Run Code Online (Sandbox Code Playgroud)
这占用了大部分测试运行时间.
这些安装可以缓存吗?
Bsq*_* ℬℬ -1
经过各种寻找和尝试,我带来了好消息。
关键问题是日志文件中的错误,例如:
bash: /tmp/buildpacks/b5ae60a477f2ba582d00a4ba23348059d40dea69cea6d982947f7c6afa72d2b8d69252449d43cbcf97a23341fd57300a3fef3224ace95482e1c0deaf8a844e4d/export: No such file or directory
Run Code Online (Sandbox Code Playgroud)
这个自动生成的目录显然是一个缓存目录,不固定时自动生成的。
例如,这可以在app.json文件中定义的heroku-buildpack-selenium buildpack中进行确认:
# parse and derive params
BUILD_DIR=$1
CACHE_DIR=$2
LP_DIR=`cd $(dirname $0); cd ..; pwd`
Run Code Online (Sandbox Code Playgroud)
我找到的官方文档证实了这一点:
CACHE_DIR 的内容将在构建之间保留。您可以在此处缓存依赖关系解析等长流程的结果,以加快未来的构建速度。
所以关键的解决方案是在安装中定义这个CACHE_DIR变量;所以我猜它要么直接在你的app.json文件中,要么直接在你的GitHub Hook中。
如果您需要进一步的帮助,请告诉我。
| 归档时间: |
|
| 查看次数: |
296 次 |
| 最近记录: |