Skip to content

Commit

Permalink
chore (quarkusio#23844): log a message when buildpack push starts/com…
Browse files Browse the repository at this point in the history
…pletes
  • Loading branch information
iocanel committed Feb 22, 2022
1 parent 2961655 commit 4be7fbb
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,25 +187,22 @@ private String runBuildpackBuild(BuildpackConfig buildpackConfig,

}).build();
log.info("Buildpack build complete");

if (containerImageConfig.isPushExplicitlyEnabled() || pushRequest.isPresent()) {
if (!containerImageConfig.registry.isPresent()) {
log.info("No container image registry was set, so 'docker.io' will be used");
}
Optional<String> r = containerImageConfig.registry;
Optional<String> g = containerImageConfig.group;
Optional<String> n = containerImageConfig.name;

AuthConfig authConfig = new AuthConfig();
authConfig.withRegistryAddress(containerImageConfig.registry.orElse("docker.io"));
containerImageConfig.username.ifPresent(u -> authConfig.withUsername(u));
containerImageConfig.password.ifPresent(p -> authConfig.withPassword(p));

log.info("Pushing image to " + authConfig.getRegistryAddress());
Stream.concat(Stream.of(containerImage.getImage()), containerImage.getAdditionalImageTags().stream()).forEach(i -> {
ResultCallback.Adapter<PushResponseItem> adapter = new ResultCallback.Adapter<>();
buildpack.getDockerClient().pushImageCmd(i).exec(adapter);
try {
adapter.awaitCompletion();
log.info("Push complete");
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
Expand Down

0 comments on commit 4be7fbb

Please sign in to comment.