Docker-maven-plugin: When deployAtEnd is set, d-m-p should push docker images after a multi-module build

Created on 20 Sep 2019  路  6Comments  路  Source: fabric8io/docker-maven-plugin

Description

The idea is cloned from maven-deploy-plugin. When the user property deployAtEnd is set, d-m-p should push all Docker images at the end of multi module build. These docker images are created during this multi module build.

  • If it's a feature request, what is your use case : In a CI build I want to ensure that the multi module build runs successfully before the docker images are pushed to the registry.

Workaround:

mvn deploy -DdeployAtEnd -Ddocker.skip.push
mvn docker:push

I think it's relate to #745

Most helpful comment

I release the first version of the Maven Extension. It is available in Maven Central

All 6 comments

I see the use case, but how would a parent pom know which images to push ? 'would have to check how the deploy plugin deals with this and maybe one can also already achieve that with d-m-p with some clever lifecycle bindings, so that the sub-modules push e.g. on the postInstall phase (which is reached only when the build doesn't break before.

I discussed the solution of the deploy plugin with @khmarbaise. He recommends me to use the Maven deployer extension for this use case in deploy plugin. Maybe for this issue it would be a good idea to write a docker push extension. What do you think?

I'm not very familiar with extensions, but sounds like a good idea ;-) Such an extension then could pick up all images to push at the end of the whole run.

I would happy to help to integrate any PR which goes in this direction.

Yes, please please make it work, it is very much needed :). We often have this kind of structure

Parent-Aggregator
|-- Module A (e.g. a common Business API)
|-- Module B, depends on A, defines image X
|-- Module C, depends on A, defines image Y
|-- Module D, product assembly, defines E2E tests and runs them utilizing images. Defines E2E test image

We usually only ever want to push images, after all E2E Tests were done.

I started a PoC for this issue.

Currently, test infrastructure and the skeleton is set up.

I release the first version of the Maven Extension. It is available in Maven Central

Was this page helpful?
0 / 5 - 0 ratings