Of course you can.
As you noticed, you need to use the "web" process type.
Remember that process types are actually simply named commands: "Each process type is a declaration of the command that runs when dyno starts this process type"
You manage a team.
In a small test application, I just created the bin directory, added the file and gave it permission to execute - like this:
mkdir bin vi bin/go.sh chmod a+x bin/go.sh
The content looked like this:
echo $* echo $FOOBAR thin --rackup config.ru start $*
Then I modified my Procfile to look like this:
web: ~/bin/go.sh --port $PORT
I also added the var configuration to my application:
heroku config: add FOOBAR = 123
Then I looked at the logs after starting
2013-03-14T11:49:42+00:00 heroku[web.1]: Starting process with command `~/bin/go.sh --port 47302` 2013-03-14T11:49:43+00:00 app[web.1]: --port 47302 2013-03-14T11:49:43+00:00 app[web.1]: 123 2013-03-14T11:49:44+00:00 heroku[web.1]: State changed from starting to up
Excellent. Do you see what happened?
- When I started web dino, Heroku looked at the type of web process and ran the command
- The command started my server, but before that it printed both the parameters passed to it (--port XXX) and the FOOBAR environment variable (which will be set in config var)
So, I think that's all you need. Just write a bash script that, depending on the var configuration, runs another command for production and production. In the configuration step, configure var. Not at the factory.
source share