Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearly distinguish configuration scripting and command scripting #2

Open
4 of 6 tasks
pjeby opened this issue Jul 31, 2018 · 0 comments
Open
4 of 6 tasks

Clearly distinguish configuration scripting and command scripting #2

pjeby opened this issue Jul 31, 2018 · 0 comments

Comments

@pjeby
Copy link
Member

pjeby commented Jul 31, 2018

Because of the way doco evolved (first as a command scripting tool, then a configuration scripting tool), there's not a terribly clear distinction in the docs or examples, but there is actually a major difference between the two. Configuration scripting (declarations) determine the content of the docker-compose configuration, including defining jq functions or adding jq filters to do so. Once the config is generated, such declarations don't have much value. Likewise, there are APIs that only make sense to use in commands.

Phase 1

  • only generate jq target functions during config loading
  • Set up read-only GROUP --all := all-services at end of load
  • disable the doco function during config loading, enable it after
  • ban service declaration after load

Phase 2

  • add a way to define conditional aliases (i.e. "if this service exists (now or in future), alias it under these names/add to these groups"); maybe something like if-service foo target --default set foo
  • force declared services to exist in config

(It may be that the aliasing feature could be considered in terms of aliases and tags: tag-service foo -- bar baz would mean, "if foo ever exists, add it to group bar", while alias-service foo doco.exec-default would mean "if foo ever exists, set group doco.exec-default equal to it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

No branches or pull requests

1 participant