Conversation
| const resolvedContext = | ||
| customContext || cluster.customContext || defaults.customContext | ||
| const resolvedContextPath = resolvedContext ? `/${name}` : '' | ||
| const runtime = makeEnvironment(argv, {}, cluster) |
There was a problem hiding this comment.
The second empty object is going to be replaced with the per-cluster cached configuration. The cluster object is the default configuration from ~/.config/d2/config.js.
amcgee
left a comment
There was a problem hiding this comment.
This looks really great!! I made a couple minor comments, but happy with it as is as well. Also yay tests!!
|
@amcgee did three changes:
|
| type: 'string', | ||
| }, | ||
| channel: { | ||
| desc: 'Set the release channel to use (default: stable)', |
There was a problem hiding this comment.
Should this use the same defaults logic as the other properties? So basically that would mean removing the if !substitutes.channel check from makeDockerImage and adding channel: 'stable' to defaults ...?
There was a problem hiding this comment.
Sure, I can change the defaults.channel to stable and use the same logic. 👍
I cannot remove the !substitutes.channel check though since the makeDockerImage function doesn't do the configuration resolution itself, and if the function is used with a substitution object which doesn't pass in the channel, it won't get replaced with an empty string. The tests catch this situation and started to error out.
It would have been a bit simpler if the stable repo was called core-stable and not just core, but I'd rather have a little bit of extra complexity here and a nicer repo name than the other way around.
amcgee
left a comment
There was a problem hiding this comment.
This is great! Tested locally, working like a charm. And now that @vilkg has pushed stable releases to dhis2/core the world is starting to make sense :-D
# [1.2.0](v1.1.0...v1.2.0) (2019-05-27) ### Features * support official docker images ([#54](#54)) ([8e2a6da](8e2a6da))
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Started with the
makeDockerImageresolutions for supporting channels and versions from https://hub.docker.com/u/dhis2.core,core-dev,core-canary)--db-version <string>--variant <array>--channel <string>Combos
Save per cluster configuration
To allow for subsequent startups without all the switches we need a mechanism (e.g. #53) to save the configuration first passed to the
upcommand.So first time the cluster is created it stores the config in e.g.
~/.cache/d2/d2-cluster/dev/configCache.jsonThis enables:
d2 cluster up dev \ --custom-context \ --channel dev \ --dhis2-version master \ --db-version dev \ --seed d2 cluster down dev d2 cluster up dev # will use the `configCache`Mentioning it here to note that implementing that is out of scope for this PR, but there are plans to do it.