我有一个像下面这样的目录结构:
my-app/
.git/
db/ <-- Database stuff
lib/ <-- Business logic
spec/
web/ <-- Rails
Run Code Online (Sandbox Code Playgroud)
Rails位于web/存储库的子目录中.Heroku默认不喜欢这个.
我有一个部分工作的heroku buildpack.它基本上要求在运行任何任务之前Dir.chdir更改为APP_SUBDIR环境变量(如果存在).
我想部署到Heroku,但我无法让资产管道任务工作.在预编译资产时,定制的buildpack将更改为web/目录并尝试运行该任务.
但是,我得到了这个错误,有以下重要的一点:
Could not detect rake tasks
ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
and using the production group of your Gemfile.
Your Ruby version is 1.9.2, but your Gemfile specified 2.0.0 (Bundler::RubyVersionMismatch)
Run Code Online (Sandbox Code Playgroud)
这很奇怪,因为Heroku清楚地说我在同一个牧场上运行2.0.事实上,当我跑:
$ heroku run 'cd web; bundle …Run Code Online (Sandbox Code Playgroud) Cloundfoundry最近将其Java buildpack更新为2.5版(包括java 8和tomcat 8).我仍然想使用2.4版本,因为我的应用还没有升级到java 8.最简单的方法是什么?
我可以使用推送应用程序
cf push app -b https://github.com/cloudfoundry/java-buildpack
Run Code Online (Sandbox Code Playgroud)
但是如何指定使用版本2.4(https://github.com/cloudfoundry/java-buildpack/releases/tag/v2.4)?显然指定标记URL不起作用.
import os
from setuptools import setup
from distutils.command.install import install as _install
def _post_install(dir):
from subprocess import call
call([sys.executable, 'post_script.py'],
cwd=os.path.join(dir, 'script_folder'))
class install(_install):
def run(self):
_install.run(self)
self.execute(_post_install, (self.install_lib,),
msg="Running post install task")
VERSION = '123'
setup(name='XXXX',
description='hello',
url='http://giturl.com',
packages=['package_folder'],
cmdclass={'install': install},
package_data={
'package_folder': [
'*.py',
'se/*pp'
],
},
)
Run Code Online (Sandbox Code Playgroud)
#基本上我应该在安装正在构建的rpm后执行postscript.它不起作用.这样的任何其他方法都不起作用?
我希望能够从我的nodejs应用程序中的命令行调用g ++(作为服务器对POST请求的响应的一部分)。
我有一个Ruby代码,它执行此操作:
browser = Watir::Browser.new(:chrome, switches: switches, headless: true)
browser.goto(....)
Run Code Online (Sandbox Code Playgroud)
当我在Heroku上运行代码时,我得到了
Selenium::WebDriver::Error::WebDriverError: Unable to find chromedriver. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github
.com/SeleniumHQ/selenium/wiki/ChromeDriver.
Run Code Online (Sandbox Code Playgroud)
我见过像Heroku这样的帖子:使用Watir/Selenium时无法连接到chromedriver 127.0.0.1:9515, 但我不知道如何正确配置buildpacks.我尝试过:
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-google-chrome
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-chromedriver
Run Code Online (Sandbox Code Playgroud)
但是当我尝试将更改推送到Heroku时,我得到:
Error Plugin: chromedriver: files attribute must be specified in /Users/leticia/.local/share/heroku/node_modules/chromedriver/package.json
Run Code Online (Sandbox Code Playgroud)
有人可以一步一步地告诉我如何设置必要的构建包以使Watir gem在Heroku中工作吗?
谢谢
更新:
我需要'网络驱动程序',现在我得到了 Selenium::WebDriver::Error::WebDriverError: unable to connect to chromedriver 127.0.0.1:9515.
我已经尝试将env vars配置为:
ENV['GOOGLE_CHROME_BIN'] = "/app/.apt/opt/google/chrome/chrome"
ENV['GOOGLE_CHROME_SHIM'] = "/app/.apt/usr/bin/google-chrome-stable"
Run Code Online (Sandbox Code Playgroud)
并这样做:
options = …Run Code Online (Sandbox Code Playgroud) 使用 Firebase 托管,当您部署应用程序时,系统会询问您是否将所有网址重写为 /index.html。这意味着无论是直接访问还是从主页导航到,react-router路由都会被正确触发。
我们使用Create-react-app和Create-react-app-buildpack部署到 Heroku。我们怎样才能以相同的方式将所有 URL 重写为 /index.html 呢?
在这个问题之后,解释了routes指令,我在根目录中配置了一个static.json,但没有效果:
{
"routes": {
"/images/*": "/images/",
"/legal/*": "/images/",
"/media/*": "/media/",
"/fav/*": "/fav/",
"/styles/*": "/styles/",
"/**": "index.html"
}
}
Run Code Online (Sandbox Code Playgroud) 我已经在互联网上完成了所有可能的解决方案,但我无法让 pyobdc 获得 heroku 上的驱动程序。
我用来创建应用程序的步骤如下:
heroku create
heroku config:set FLASK_CONFIG=heroku
heroku buildpacks:add heroku/python
heroku buildpacks:add --index 1 heroku-community/apt
git push heroku master
Run Code Online (Sandbox Code Playgroud)
我什至尝试使用 odbc buildpack 但仍然没有运气:
heroku buildpacks:add https://github.com/iFix/heroku-buildpack-odbc.git
Run Code Online (Sandbox Code Playgroud)
在浏览微软网站后,我精简了我的 Aptfile 以指导 heroku 安装以下软件包:
# install msodbcsql17
https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/msodbcsql17/msodbcsql17_17.4.2.1-1_amd64.deb
# install mssql-tools
https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/mssql-tools/mssql-tools_17.4.1.1-1_amd64.deb
# install unixodbc-dev
unixodbc-dev
Run Code Online (Sandbox Code Playgroud)
这使得 pyodbc 安装没有错误。但是当我运行 pyodbc.drivers() 时,它什么都不返回。Ubuntu 16.04 上的相同命令返回“ODBC Driver 17 for SQL Server”
该项目的源代码位于:https : //github.com/IamVNIE/odbcTestHeroku
托管应用程序位于:https : //pyodbctest.herokuapp.com/
有人可以提供一些指导来完成这项工作。
我正在使用 Spring Boot 2.3.0.M1引入的 Spring buildpacks来创建基于 Spring 的应用程序的 Docker 映像。一切顺利,我可以通过执行./gradlew bootBuildImageGradle 任务为每个应用程序创建 docker 图像,将 docker-compose 文件指向创建的图像(例如image: spring-test:latest),最后成功运行所有应用程序(docker-compose up)。
即使我有一个 bash 脚本来自动化构建过程,我还是想摆脱这个额外的步骤,让 Spring buildpacks 任务在我运行docker-compose up --build命令时自动执行,这样每个应用程序的 docker 镜像都会被构建并上传到主机的本地 docker 存储库,docker compose 将从该存储库中接管。
我的第一次尝试是为bootBuildImage在主机上执行任务的每个应用程序创建一个虚拟 Dockerfile ,但这需要从 docker 到主机的 SSH 连接,甚至不确定它是否能正常工作。
另一个想法是使用类似的方法,唯一的变化是首先将应用程序的源代码挂载或复制到 docker,配置 buildpacks 将图像存储到主机的本地 docker 镜像 repo(可能是 SSH 连接),最后在 docker 上执行 buildpacks。
我想知道是否有更好,更优雅的解决方案。
我正在使用GitLab\xe2\x80\xafCI Auto\xe2\x80\xafDevOps在 DinD (docker-in-docker) 运行器中编译一个基于 Maven 的项目。
\nCI 作业启动,并且正确检测到 Maven 的构建包(基于 herokuish)。
\n如何配置自定义settings.xml文件而不切换到自定义.gitlab-ci.yml?
我想继续使用 Auto\xe2\x80\xafDevOps。
\n我需要使用spring-boot:build-imageand将自签名证书添加到 spring-boot docker 映像中paketo-buildpacks/ca-certificates,但无法使其工作。
所以:
paketo-buildpacks/ca-certificates绑定?mvn spring-boot:build-image?到目前为止我尝试过但没有成功:更新 pom.xml spring-boot-maven-plugin:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<bindings>
<binding>${basedir}/bindings/ca-certificates:/platform/bindings/ca-certificates</binding>
</bindings>
</image>
</configuration>
<executions>
<execution>
<goals>
<goal>build-image</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
来自${basedir}文件夹:
mkdir bindings
mkdir bindings/ca-certificates
echo "ca-certificates" > bindings/ca-certificates/type
cp ~/.ssh/mycert.pem bindings/ca-certificates/
mvn spring-boot:build-image
Run Code Online (Sandbox Code Playgroud)
编辑:按照 @nick-valanos 的建议,将图像绑定配置直接移动到 boot-plugin 下(而不是在特定执行中)并解决了问题。
buildpack ×10
heroku ×5
deployment ×1
docker ×1
gitlab ×1
gitlab-ci ×1
java ×1
maven ×1
odbc ×1
paketo ×1
pyodbc ×1
python ×1
reactjs ×1
rpmbuild ×1
setuptools ×1
spring ×1
spring-boot ×1
sql-server ×1
webdriver ×1