这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@josegonzalez
Copy link
Member

This PR is an attempt at consolidating configuration retrieval and setting within the config plugin. This would enable developers to replace their config plugin with another plugin, one potentially backed by a database, and therefore would allow users to deploy a cluster of dokku instances backed by a single configuration database.

  • Added the --export option to dokku config.
  • Switch to config:set where possible.
  • Use eval (oooo evil) to set config env vars in the current context.

Todo:

  • Remove all remaining checks for ENV files.
  • Add dokku config:has ENV_VAR method.
  • Fix cases where we are concatenating the raw ENV files for docker container runs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the test fails be because of this^?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, thats it alright :(

@josegonzalez
Copy link
Member Author

@michaelshobbs what is the sed stuff here supposed to be doing?

@josegonzalez josegonzalez changed the title [DO NOT MERGE] Consolidate config Consolidate config Aug 21, 2015
@josegonzalez
Copy link
Member Author

Figured out the issue and now everything is consolidated!

@michaelshobbs
Copy link
Member

That sed stuff reformats shell export statements to the docker env file format.

from https://docs.docker.com/reference/commandline/run/

The --env-file flag takes a filename as an argument and expects each line to be in the VAR=VAL format, mimicking the argument passed to --env. Comment lines need only be prefixed with #

@josegonzalez
Copy link
Member Author

Yeah, I figured it out and everything should be fine now :)

@michaelshobbs
Copy link
Member

I get why from a code perspective we would want to do this. However, I'm uncomfortable with how often we are calling dokku from within dokku. The more we do this the longer traces get and the hard it is to troubleshoot issues. This is obviously one of the shortcomings with bash. Just my opinion though.

What if we had an export_config()function and --export called that? Then we could use that function internally as well?

@josegonzalez
Copy link
Member Author

The point of this is so that we can replace the config plugin with something else. If we just shove it into the common functions, that doesn't really help the matter.

@michaelshobbs
Copy link
Member

Why not put the function in the config plugin and that was other plugins can implement it?

EDIT: My thinking is to optimize for core ease of use while giving the option of reimplementation to the plugin community. "Batteries included but replaceable" 😄

@josegonzalez
Copy link
Member Author

As in put it in a functions file and source that in other plugins when needed?

@michaelshobbs
Copy link
Member

Yeah. I don't like the cross plugin sourcing bit, but again, we're doing this in bash....so....compromises?

@josegonzalez josegonzalez force-pushed the jg-consolidate-config branch from d8b13a1 to cddc4af Compare August 30, 2015 05:26
@josegonzalez
Copy link
Member Author

I think this is good to merge, @michaelshobbs ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update with config_export?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also allow access to this via a function instead of a full dokku execution?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want this to be

trap 'rm -rf "$TMPFILE" > /dev/null' INT TERM EXIT

josegonzalez added a commit that referenced this pull request Sep 1, 2015
@josegonzalez josegonzalez merged commit 06b2347 into master Sep 1, 2015
@josegonzalez josegonzalez deleted the jg-consolidate-config branch September 1, 2015 20:39
@josegonzalez josegonzalez changed the title Consolidate config Consolidate configuration management into config plugin Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants