Closed AlJohri closed 9 years ago
Currently you'd have to do:
mkdir /home/dokku/<app>
vim /home/dokku/<app>/ENV
In ENV
you'd add:
export HEROKU=1
export C_FORCE_ROOT=1
git init --bare
isn't required since #391, so a create
command would only have to mkdir /home/dokku/<app>
Ah yes, thanks
In addition to that, I think you'd need to add a conditional here (https://github.com/progrium/dokku/blob/master/plugins/config/commands#L127) to set RESTART_APP=false
if $DOKKU_ROOT/$APP/CONTAINER
doesn't exist.
This allows you to run a dokku create command which just does:
mkdir -p $DOKKU_ROOT/$APP
touch $DOKKU_ROOT/$APP/ENV
and then you can use the regular dokku config plugin to set the variables dokku config:set HEROKU=1
Should I submit a PR for this?
Should I submit a PR for this?
Yes please!
+1 for a dokku create
that will create the app complete with CONTAINER
but stops short of processing the buildpack. It is not only environment variables that introduces these "chicken or egg" scenarios as you may require a database or similar services which are produced by other plugins, all dependent on the existence of an app, which in turn fails in their absence and so on and so forth.
It sucks to first have to create an app but it sucks way less than having to wait for an app to crash first, when you know it will only to do the settings it requires afterwards.
What would really kick ass though, if we could decouple these interdependencies and make it irrelevant whether the chicken came before the egg or the other way around. @jazzzz do you have a solution like that?
+1
I implemented the create
command in PR #599.
You can now use dokku apps:create APP_NAME
and then dokku config:set
as you might on heroku.
What would be the quickest way to implement sending config variables before the first push? I have an app that requires:
or else it won't push properly. It would be nice to be able to set the config variables prior as opposed to: (1) push, (2) set variables, and (3) restart.
Perhaps a way to dokku create $APP that just creates an empty folder in /home/dokku with a blank ENV file ready to be written to?