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

feat: add cluster db commands, update images on up, add compose cmd #95

Merged
merged 6 commits into from
Jul 2, 2019

Conversation

amcgee
Copy link
Member

@amcgee amcgee commented Jul 2, 2019

This feature PR adds a few handy commands to the cluster namespace:

  1. It adds d2 cluster db backup <name> <path> and d2 cluster db restore <name> [path] for easy database lifecycle management outside the cluster volumes.
  2. It adds the d2 cluster compose <name> -- [args...] command which passes through to the underlying docker-compose and allows the user to perform arbitrary docker-compose commands without needing to specify the compose project name or the location of the docker-compose.yml file (which is in the d2 cache). An example usage is d2 cluster compose dev -- exec db 'sh' which will execute an interactive shell terminal in the db container.
  3. It enhances the d2 cluster up command by automatically pulling the latest docker images when --update is specified

This also deprecates the d2 cluster seed command (it's still there to prevent a breaking change, but hidden from the help output) in favor of d2 cluster db restore

@amcgee
Copy link
Member Author

amcgee commented Jul 2, 2019

One question here - does d2 cluster compose make sense to pass-through commands to the underlying docker-compose?

It might be a bit obtuse, something like exec or run could be better. However those would be confusing because there are also concepts of run and exec for custom commands or containers within the compose cluster (i.e. d2 cluster compose <name> -- exec db 'sh' to SH into the running db container).

@janhenrikoverland
Copy link

janhenrikoverland commented Jul 2, 2019

Centralize and reuse e.g. commands -> cacheLocation?

@amcgee
Copy link
Member Author

amcgee commented Jul 2, 2019

Centralize and reuse e.g. commands -> cacheLocation?

Yeah, definitely agree. I'll leave that for later though since it would touch a bunch more files. Thanks for the review @janhenrikoverland !

@amcgee amcgee merged commit 7dd4fc1 into master Jul 2, 2019
@amcgee amcgee deleted the feat/cluster-db-commands branch July 2, 2019 13:37
dhis2-bot pushed a commit that referenced this pull request Jul 2, 2019
# [1.4.0](v1.3.0...v1.4.0) (2019-07-02)

### Features

* add cluster db commands, update images on up, add compose cmd ([#95](#95)) ([7dd4fc1](7dd4fc1))
@dhis2-bot
Copy link
Contributor

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

Successfully merging this pull request may close these issues.

3 participants