mirror of
https://github.com/jlengrand/quarkus.git
synced 2026-03-10 08:41:22 +00:00
feat: add login support to docker push.
This commit is contained in:
committed by
Georgios Andrianakis
parent
297d561433
commit
084e905bce
@@ -114,6 +114,13 @@ public class DockerProcessor {
|
||||
}
|
||||
|
||||
if (pushRequested || containerImageConfig.execution == ContainerImageConfig.Execution.PUSH) {
|
||||
// Check if we need to login first
|
||||
if (containerImageConfig.username.isPresent() && containerImageConfig.password.isPresent()) {
|
||||
boolean loginSuccesful = ExecUtil.exec("docker", "-u", containerImageConfig.username.get(), "-p" + containerImageConfig.password.get());
|
||||
if (!loginSuccesful) {
|
||||
throw dockerException(new String[] {"-u", containerImageConfig.username.get(), "-p", "********"});
|
||||
}
|
||||
}
|
||||
String[] pushArgs = { "push", image };
|
||||
boolean pushSuccessful = ExecUtil.exec("docker", pushArgs);
|
||||
if (!pushSuccessful) {
|
||||
|
||||
Reference in New Issue
Block a user