-
Notifications
You must be signed in to change notification settings - Fork 635
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
Configuration option to execute docker:stop in case of the failing build #915
Comments
Are you using the surefire or failsafe plugin for running the tests ? I asks because the failsafe plugin is supposed to call post-integration-test even when the the test fails. In the docs:
|
We are not using it.. If this solution does work, then you can close the issue.. Thanks @rhuss, I will try this out.. |
Cool. Let me know if this works for you, so that we can close this issue. |
This actually does not work in my case with the failsafe plugin. I hook the
I am not sure if the setup of failsafe is correct, I simply copied the one from the official page:
However, |
+1 the container is not stopping incase of test failures. But I use surefire to run my test. |
Same Problem here.
Container is still up and running pom.xml
|
Subscribed to this thread as I am facing the same problem. |
Same situation here, but I'm not running in integration-test phase. I'm running flyway Around this I'm trying to wrap fabric8's I'm also left with live containers if there are any failures, e.g. a SQL error in a flyway migration. |
I had the same issue, I fixed it by separating the goals Maybe it's not a bad idea to stop the container after some time/phase by default.
I'm using it to start a server that connects to an external SOAP API. |
Same issue here |
Would be nice if docker containers that were started by the plugin would stopped in case of a graceful JVM shutdown (implementing a shutdown hook in the plugin). I use this plugin for generate-sources and I have no place to stop the container. |
@balazs-zsoldos : Would it be possible for you to contribute this to our project? |
@rohanKanojia Sure. I will try to have a look in the following days at the source and send a PR. |
@rohanKanojia I only found slightly hacky way. See #1492 |
@ivansenic @stefanwendelmann @arunkumargan : Hi guys, @balazs-zsoldos has proposed a fix for this bug #1492 via a configuration flag. Would it be possible for you to review it or maybe try out his fix by building a SNAPSHOT locally? Would appreciate it if you could provide some feedback regarding this 🙏 |
The latest version v0.38.0 should contain the fix provided by @balazs-zsoldos . Would appreciate if you could try out and provide feedback 🙏 In case it doesn't fix the issue, I can reopen the issue |
@rohanKanojia I am able to test the fix because I am on v0.38.1 and I reproduce the issue but you don't explain here or in #1492 |
@alahaouas : I think it was enabled by You can read about in provided stop configuration[0] |
@rohanKanojia the fix isn't working : the maven build fails before the stop execution is triggered.
|
I guess the fix would be for the docker:start configuration. |
To reproduce, couple flyway with the plugin and add a faulty sql file |
Your doc says to use maven-failsafe-plugin to achieve a proper cleanup. |
@alahaouas : We have a sample with maven-failsafe-plugin https://github.com/fabric8io/docker-maven-plugin/blob/master/samples/cargo-jolokia/pom.xml#L164 . Could you please review this to see if it fits your use case? |
@rohanKanojia I already use maven-failsafe-plugin in my pom. Just using it isn't working as a work-around. |
@rohanKanojia the fix from #1492 doesn't work for me. Do you have an alternative solution ? |
Same here. Can't this issue be reopened? |
Description
We use the plugin the start some docker images in the
pre-integration-test
phase and stop them in thepost-integration-test
. This works very well. However, if any of the integration tests fails the build, then the created docker containers remain running. Thus, it would be great if there would be a configuration option to rundocker:stop
in case the build fails. This way everything would be cleaned up correctly.This is a feature request, however I am not sure how hard it is to implement this or if it's possible at all.
The text was updated successfully, but these errors were encountered: