Fix #34 Create a RunContainersMojo that allows you to use mvn docker:run #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a very basic implementation as it stands.
Right now you have a few options:
mvn docker:run
- Start up the containersmvn docker:build-images docker:run
- Build missing images and start up the containersmvn package docker:run
- Rebuild the images and start up the containersYou could start trying to force the docker:run goal to build images as well as running them, but then you'll be duplicating parts of the build images MOJO for the config and you'll have to extract the functions it uses out into a separate class (Unless there is some Maven magic that allows you to force the run of multiple goals inside a MOJO I don't know about at the moment).
Once the containers have started the code drops into an infinite loop until CTRL + C has been pressed. You could start adding state to the containers and check that they are still in a running state instead of just having an infinite loop, or you could continually query the remote API to see if they are still up and running, but that's a bit more work (And I don't think it's really going to add much additional benefit).