Deploy war file to heroku including additional files

六月ゝ 毕业季﹏ 提交于 2020-06-22 04:00:34

问题


I am deploying a war file to heroku and want to include additional properties file to the slug as described here:

Configuring WAR Deployment with the Heroku CLI

$ heroku war:deploy application.war --app awesomeapp --jdk 14 --includes app1.properties

It deploys war file successfully, but in any subfolder of the expanded application I can't find app1.properties file. At the same time all other files from war archive are on their places, additional tomcat war-tracker file, and nothing more. I tried to add some jar file with same result:

$ heroku war:deploy application.war --app awesomeapp --jdk 14 --includes app1.properties:some-lib.jar

Question: Where does heroku include additional files? How to get access there?

This is the output of the heroku-cli:

Uploading application.war
-----> Packaging application...
       - app: awesomeapp
       - including: app1.properties
       - including: some-lib.jar
       - including: webapp-runner.jar
       - including: application.war
-----> Creating build...
       - file: slug.tgz
       - size: 30MB
-----> Uploading build...
       - success
-----> Deploying...
remote:
remote: -----> heroku-deploy app detected
remote: -----> Installing JDK 14... done
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 96.9M
remote: -----> Launching...
remote:        Released v14
remote:        https://awesomeapp.herokuapp.com/ deployed to Heroku
remote:
-----> Done

回答1:


Those files will be added to the root of your Heroku application and won't be put into the expanded application directory.

You can verify your file is present in your Dynos by running heroku run "cat app1.properties". If you want to explore the file system yourself, heroku run bash allows you to delve though it.

Edit: If you need a path to the file, you can construct one using

String path = System.getProperty("user.home") + File.separator + "app1.properties";


来源:https://stackoverflow.com/questions/61532148/deploy-war-file-to-heroku-including-additional-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!