dokku-require icon indicating copy to clipboard operation
dokku-require copied to clipboard

First Push Only Options

Open crisward opened this issue 9 years ago • 4 comments

It would be good to enable some options to only apply on first push / or perhaps if they don't already exist. (as per discussion here https://github.com/dokku/dokku/issues/2269)

Env vars are mentioned as an issue, but dokku-require doesn't specifically support env vars. However having a 'firstpush' option could be useful in general.

Dokku may add something to core for this, but here could be a good place to experiment with the feature.

eg.

"dokku":{
    "plugins":[
      {
        "name":"mariadb",
        "firstpush":true,
        "commands":["mariadb:create mydb","mariadb:link mydb $APP"]
      }
    ]
  }

crisward avatar Jul 07 '16 08:07 crisward

Or better would be something like phase?

josegonzalez avatar Jul 07 '16 08:07 josegonzalez

What options would you have under phase?

crisward avatar Jul 07 '16 08:07 crisward

I think it makes sense to make "firstpush": true the default option. Are there even any cases when recreating a plugin on each push is a desired behaviour?

notpushkin avatar Oct 20 '16 06:10 notpushkin

Just to clarify, it never 'recreates' a plugin if it already exists. So if you have postgres setup and linked, it will not add it the second time. But if you delete your database and repush, it will then recreate it. I personally find this useful as the ability to wipe and re-push during development can be very useful.

The attempted re-create of plugins doesn't really take any significant time so I think I'm going to leave this for now. I'll revisit this if it seems necessary in the future.

crisward avatar Mar 06 '17 19:03 crisward