Skip to content

Commit

Permalink
Don't fail build if volume-clean fails.
Browse files Browse the repository at this point in the history
This fix is admittedly simplistic.  It does not take into account any of the
other possible causes for an exception.  However, if you are using volume-clean,
chances are you're using volume-create, or many of the other goals provided by
DMP.  In that case, you will almost certainly receive errors pointing you at the
real problem.
  • Loading branch information
Edwin Wiles committed May 25, 2017
1 parent 09b6e74 commit 23f1b29
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ public String createVolume(VolumeConfiguration vc) throws DockerAccessException
}

public void removeVolume(String volumeName) throws DockerAccessException {
docker.removeVolume(volumeName);
try {
docker.removeVolume(volumeName);
} catch ( DockerAccessException dae ) {
// IGNORE
// If you're using volume-clean, the most likely cause for a failure
// is that the volume doesn't exist. In that case, the build should
// not be failed. For any other probable cause of failure, another
// goal will almost certainly point you at the real problem.
}
}
}

0 comments on commit 23f1b29

Please sign in to comment.