0

So, I have an application deployed to heroku. In heroku i have a Procfile with the following content:

web: env CONF_listener__port=$PORT bash "./startServer.sh"

When the above command is executed then the shell scripts launches fine. This shell script opens a jar file and the jar file creates a config.txt file. This config.txt file contains username and password that is needed to run some part of the application. Also, The jar is basically a server which won't close until the app is restarted.

The problem i am having is the config.txt file created above is placed on a different dyno. This is because above bash ".startServer.sh" command will spawn a new dyno.

Now, I cannot access it. So, I was wondering if there is any way through which i could grab that config.txt file or may be tell heroku not to spawn a new dyno when bash command is used.

How does the above bash command spawn a new dyno when the dyno count for my app is only 1.

lambad
  • 1,046
  • 10
  • 21
  • 1
    Bash doesn't boot a new dyno. The only way to do so is through the platform api: https://devcenter.heroku.com/articles/platform-api-reference#dyno-create – Damien MATHIEU Apr 18 '18 at 08:03
  • Maybe i did not understand correctly but in the book Heroku, Up and Running, There is a sentence in the section Asset debugging as given below,------> "Once deployed successfully, you may want to investigate the files that were generated. The easiest way to do this is with the heroku run bash command. This command will spin up a new dyno with your application loaded and give you access to the shell: " So, I am confused with that part of the sentence. – lambad Apr 18 '18 at 08:47
  • 2
    Yes, `heroku run bash` does boot a new dyno. But the command in your Procfile doesn't. Heroku Exec can allow you to run a debug process within a running dyno: https://devcenter.heroku.com/articles/exec – Damien MATHIEU Apr 18 '18 at 09:26

0 Answers0